Pod Disruption Budgets (PDBs) for Safe Node Maintenance
Protect availability during drains and voluntary disruptions with PDBs.
In plain words
A PDB is the shop rule that maintenance may close only a certain number of checkout lanes at once. The simple Kubernetes rule is: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
Think of it like…
A PDB is the shop rule that maintenance may close only a certain number of checkout lanes at once.
Where you’ve seen it
During a release or scale event, the workload owner runs kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data. Expected evidence: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee. If the run instead shows this symptom, stop and restore the last known state: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node.
Words you’ll hear
- PDB
- For this lesson, PDB is the controlling idea: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
- minAvailable
- minAvailable is the checkpoint; run
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-dataand inspect the owner chain. Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node. - Drain Safety
- Drain Safety is the outcome to preserve; the cost is explicit: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.
- Verification evidence
- The evidence command is
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data. It connects the declaration to this behavior: Protect availability during drains and voluntary disruptions with PDBs.
Visual diagram
Theory & deep dive
How PDB reaches the intended state
Protect availability during drains and voluntary disruptions with PDBs. A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
The concrete checkpoint is kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data; compare the PDB owner, minAvailable state, and Drain Safety outcome instead of treating YAML acceptance as proof.
Run kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data after the change and correlate the result with Events and the owning object. A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
minAvailable: failure boundary and production cost
Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node. The prerequisite contract is concrete: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology. A safe design limits blast radius, records the last good configuration, and uses kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data as a deterministic rollback checkpoint.
Capture the current state with kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data, then correct the controlling manifest rather than patching a child object; the relevant divergence signal is specific: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node.
How it works, step by step
Step 1 of 41. Declare workload intent
Write the controller-owned Pod or scaling intent and preserve the owner chain: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
- Goal
- Protect availability during drains and voluntary disruptions with PDBs.
- Owner
- PDB
When to use it & trade-offs
What it is
Protect availability during drains and voluntary disruptions with PDBs. A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
Why it matters: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node. The invariant at risk is specific: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee. The quickest fact check before changing the design is kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data.
When to reach for it
- Use PDB to enforce this invariant: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
- Use minAvailable evidence from
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-datain reviews and incident timelines. Protect availability during drains and voluntary disruptions with PDBs. - Choose the progressive-delivery layer route only when this cost is justified by governance or scale: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.
When to avoid or be careful
- Avoid assuming PDB is complete after YAML submission; the required behavior is concrete: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
- Avoid treating the next symptom as random; check the owner and state with
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-datafirst: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node. - Avoid adopting a heavier platform wrapper before measuring its cost: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.
Native, manual, and managed paths for PDB
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data.Strengths: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
Watch out: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology. Recovery must also recognize this signal: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node.
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data; the expected invariant is: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.Strengths: kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data gives immediate feedback without first building a platform layer.
Watch out: A manual change can hide drift, and unlike PDB, it does not make this symptom self-documenting: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node.
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data.Strengths: Platform controls can wrap this exact behavior in policy or dashboards: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
Watch out: The added platform ownership buys value at this cost: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.
Interview signals & numbers to know
When this topic comes up
- Interview anchor: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
- Trace PDB to Drain Safety through minAvailable; the invariant is: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
- Recognize the symptom: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node.
- Justify the cost: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.
- Verify with kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data instead of only inspecting YAML.
Benchmarks & rules of thumb
- 0
- protection from involuntary node or process failure is guaranteed by a PDB
- 1
- minimum healthy voting or traffic population must be set deliberately
- 100%
- minAvailable can intentionally stop all voluntary eviction
Common mistakes & follow-ups
Common interview mistakes
- Debugging only the child object misses the PDB owner contract: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee.
- Ignoring this telltale condition leads to unrelated changes: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node.
- Repeating
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-datawithout an owner for remediation wastes retry cost. PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.
Likely interviewer follow-ups
- How would API output and runtime evidence prove this behavior: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee?
- Which owner object, logs, and Events would you inspect for this symptom-Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node-?
- At what threshold would this cost become unacceptable: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology?
kubectl get pdb -A; kubectl drain worker-2 --ignore-daemonsets --delete-emptydir-data, name the failure, then justify the cost. Invariant: A PDB constrains how many selected Pods may be voluntarily unavailable during evictions, such as a drain, while health failures and forced deletion are outside its guarantee. Failure: Setting minAvailable equal to every replica blocks voluntary node drains, and a PDB cannot protect replicas that all fail on one underlying node. Cost: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.Knowledge check
Put it into practice
Practice related interview Q&A
Apply Pod Disruption Budgets (PDBs) for Safe Node Maintenance with generative AI interview Q&A and hands-on practice.