-
Notifications
You must be signed in to change notification settings - Fork 426
Description
Description
Observed Behavior: Karpenter cannot disrupt a node if there's a pod with PDB (minAvailable: 100%) despite having a NodeClaim with both expireAfter (720h) and terminationGracePeriod (1h).
Expected Behavior: Once the terminationGracePeriod elapses, remaining pods should be forcibly deleted and the underlying instance will be terminated. Source: https://karpenter.sh/docs/concepts/disruption/#terminationgraceperiod
Reproduction Steps (Please include YAML):
- Deploy a Pod with a PDB like the following:
apiVersion: v1
kind: Pod
metadata:
name: nginx-test-pdb-pod
labels:
app: nginx-test-pdb-pod
spec:
nodeSelector:
karpenter.sh/nodepool: test-huge-crowd-general
tolerations:
- key: taint.nr-ops.net/general-pool
operator: Exists
effect: NoSchedule
containers:
- name: nginx
image: nginx:latest
ports:
- containerPort: 80
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: nginx-test-pdb
spec:
minAvailable: 1
selector:
matchLabels:
app: nginx-test-pdb-pod-
Manually drain the node with
kubectl drain node <node> ... -
Observe that the node gets in unschedulable state and never gets deleted (even after the grace period of 1h has expired), causing a costs increase. (FWIW if the pod is deleted manually then Karpenter removes the node eventually).
│ Events: │
│ Type Reason Age From Message │
│ ---- ------ ---- ---- ------- │
│ Normal Unconsolidatable 13m (x86 over 23h) karpenter Can't replace with a cheaper node │
│ Normal DisruptionBlocked 26s karpenter Pdb "default/nginx-test-pdb" prevents pod evictions
Versions:
- Chart Version:
1.3.2 - Kubernetes Version (
kubectl version):v1.32.9-0
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment