Skip to content

Commit

Permalink
fix(stacks.api/addons/arc): prevent karpenter from evicting ephemeral…
Browse files Browse the repository at this point in the history
… runners

Signed-off-by: Braden Mars <bradenmars@bradenmars.me>
  • Loading branch information
BradenM committed Sep 22, 2023
1 parent bf36208 commit 9a3d252
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion packages/stacks/api/src/addons/arc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ export class ARCScaleSet extends blueprints.HelmAddOn {
{
githubConfigUrl: this.options.githubConfigUrl,
githubConfigSecret: this.options.githubConfigSecret,
template: this.createTemplateSpec(),
template: this.createTemplate(),
controllerServiceAccount: {
namespace: sa.serviceAccountNamespace,
name: sa.serviceAccountName,
Expand Down Expand Up @@ -588,4 +588,23 @@ export class ARCScaleSet extends blueprints.HelmAddOn {
this.createRunnerContainerSpec(),
)
}

/**
* Create template helm value for runners.
* @protected
*/
protected createTemplate() {
const spec = this.createTemplateSpec()
const metadata = {
annotations: {
// prevent karpenter from evicting / attempting to reschedule active runners.
// This may be problematic if minRunners >= 1, but should work well if minRunners = 0.
'karpenter.sh/do-not-evict': 'true',
},
}
return {
...spec,
metadata,
}
}
}

0 comments on commit 9a3d252

Please sign in to comment.