Skip to content
Latchkey

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.

kubectl output
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                     5m

Common 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.

pdb.yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: { name: api }
spec:
  maxUnavailable: 1        # or minAvailable: <replicas - 1>
  selector:
    matchLabels: { app: api }

Check the math against replicas

  1. Run kubectl get pdb api -o wide and read ALLOWED DISRUPTIONS.
  2. Ensure minAvailable is strictly less than the Deployment’s replica count.
  3. Scale replicas up if you genuinely need zero disruption and still want rollouts.

How to prevent it

  • Keep minAvailable strictly below replica count so at least one pod can move.
  • Avoid maxUnavailable: 0 unless you intentionally want to block all voluntary disruption.
  • Review PDBs whenever you change replica counts so they stay satisfiable.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →