Founding prices until 15 December: 30% off Pro, locked for life. See pricing

$ … Cannot evict pod as it would violate the pod's disruption budget

kubectl drain stuck: 'would violate the pod's disruption budget'

A PodDisruptionBudget allows no more disruptions, so drain waits forever.

Kubernetes

What it means

kubectl drain evicts Pods through the eviction API, which respects PodDisruptionBudgets. If a PDB says minAvailable equals the replica count (or there's only one replica), no eviction is allowed and drain retries endlessly.

Causes and fixes

Most likely first. Run the check, and if it matches, apply the fix.

1. The PDB allows zero disruptions

Check:

kubectl get pdb -A   # ALLOWED DISRUPTIONS 0

Fix: Scale the workload up first, or relax the PDB (maxUnavailable 1).

2. Pods that aren't managed by a controller, or use emptyDir

Check:

kubectl drain <node> --ignore-daemonsets --dry-run=client

Fix: Use --delete-emptydir-data, and recreate unmanaged Pods elsewhere.

Fix it yourself

A live machine in your browser with this problem already on it. The grader checks the result.

Open the lab

No account needed for your first tries.

Related errors

  • Node NotReady

    The node's kubelet stopped reporting healthy, so no new Pods go there and existing ones may be evicted.