File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -39,13 +39,15 @@ func IsActive(pod *corev1.Pod) bool {
39
39
// - Is an active pod (isn't terminal or actively terminating) OR Is owned by a StatefulSet and Is Terminating
40
40
// - Isn't owned by a DaemonSet
41
41
// - Isn't a mirror pod (https://kubernetes.io/docs/tasks/configure-pod-container/static-pod/)
42
+ // - Does not have the "karpenter.sh/do-not-disrupt=true" annotation (https://karpenter.sh/docs/concepts/disruption/#pod-level-controls)
42
43
func IsReschedulable (pod * corev1.Pod ) bool {
43
44
// StatefulSet pods can be handled differently here because we know that StatefulSet pods MUST
44
45
// get deleted before new pods are re-created. This means that we can model terminating pods for StatefulSets
45
46
// differently for higher availability by considering terminating pods for scheduling
46
47
return (IsActive (pod ) || (IsOwnedByStatefulSet (pod ) && IsTerminating (pod ))) &&
47
48
! IsOwnedByDaemonSet (pod ) &&
48
- ! IsOwnedByNode (pod )
49
+ ! IsOwnedByNode (pod ) &&
50
+ ! HasDoNotDisrupt (pod )
49
51
}
50
52
51
53
// IsEvictable checks if a pod is evictable by Karpenter by ensuring that the pod:
You can’t perform that action at this time.
0 commit comments