Kubernetes PodDisruptionBudget maxUnavailable Blocks Rollout in CI
A PodDisruptionBudget limits how many pods may be voluntarily disrupted at once. With maxUnavailable: 0 (or a value the current replica count can never satisfy), the budget allows zero disruptions, so a rolling update or node drain can never make progress.
What this error means
A kubectl drain or a surge-limited rollout stalls, and the API reports the disruption is denied by the PDB. kubectl get pdb shows ALLOWED DISRUPTIONS at 0.
Cannot evict pod as it would violate the pod's disruption budget.
$ kubectl get pdb api
NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE
api N/A 0 0 5mCommon causes
maxUnavailable: 0 forbids all voluntary disruption
A PDB with maxUnavailable: 0 (or minAvailable equal to the replica count) permits zero disruptions, so any eviction-based operation is blocked indefinitely.
Budget tighter than the replica count allows
A minAvailable set higher than (or equal to) replicas leaves no room for even one pod to be unavailable, so rollouts and drains cannot proceed.
How to fix it
Allow at least one disruption
Set the budget so the update/drain can take one pod down while keeping availability.
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: { name: api }
spec:
maxUnavailable: 1 # or minAvailable: <replicas - 1>
selector:
matchLabels: { app: api }Check the math against replicas
- Run
kubectl get pdb api -o wideand readALLOWED DISRUPTIONS. - Ensure
minAvailableis strictly less than the Deployment’s replica count. - Scale replicas up if you genuinely need zero disruption and still want rollouts.
How to prevent it
- Keep
minAvailablestrictly below replica count so at least one pod can move. - Avoid
maxUnavailable: 0unless you intentionally want to block all voluntary disruption. - Review PDBs whenever you change replica counts so they stay satisfiable.