Skip to content

Commit 716b3e4

Browse files
committed
fix: add karpenter do-not-disrupt annotation to pod templates
Pre-init Job pods and StatefulSet pods were being evicted by Karpenter node consolidation, causing immediate Job failure with backoffLimit: 0. Add karpenter.sh/do-not-disrupt annotation to both pod templates to prevent eviction during bootstrap and normal operation.
1 parent 0888040 commit 716b3e4

2 files changed

Lines changed: 14 additions & 4 deletions

File tree

internal/controller/node/job.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,13 @@ func generatePreInitJob(node *seiv1alpha1.SeiNode, platform PlatformConfig) *bat
3535
BackoffLimit: ptr.To(int32(0)),
3636
TTLSecondsAfterFinished: ptr.To(int32(3600)),
3737
Template: corev1.PodTemplateSpec{
38-
ObjectMeta: metav1.ObjectMeta{Labels: labels},
39-
Spec: buildPreInitPodSpec(node, snap, platform),
38+
ObjectMeta: metav1.ObjectMeta{
39+
Labels: labels,
40+
Annotations: map[string]string{
41+
"karpenter.sh/do-not-disrupt": "true",
42+
},
43+
},
44+
Spec: buildPreInitPodSpec(node, snap, platform),
4045
},
4146
},
4247
}

internal/controller/node/resources.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ func generateNodeStatefulSet(node *seiv1alpha1.SeiNode, platform PlatformConfig)
3333
MatchLabels: labels,
3434
},
3535
Template: corev1.PodTemplateSpec{
36-
ObjectMeta: metav1.ObjectMeta{Labels: labels},
37-
Spec: buildNodePodSpec(node, platform),
36+
ObjectMeta: metav1.ObjectMeta{
37+
Labels: labels,
38+
Annotations: map[string]string{
39+
"karpenter.sh/do-not-disrupt": "true",
40+
},
41+
},
42+
Spec: buildNodePodSpec(node, platform),
3843
},
3944
},
4045
}

0 commit comments

Comments
 (0)