Interview's MateKubernetes
Interview's Mate

Kubernetes

K8s · Workloads · GitOps · Cloud

Visualizer

DSA Visualizer
All 32 lessons
Custom Playground
Try your own examples

Learning

System Design
31 architecture topics
SQL Learning
160 foundations → production topics
AI Engineering
160 LLM → backend topics
Data Science
160 Python → MLOps topics
Data Engineer
160 SQL → streaming topics
Docker
160 Docker learning topics
Kubernetes
160 K8s fundamentals → cloud
Java LearnSoon
Coming soon
Python Learn
Interview Q&A & internals
JavaScript Learn
Closures, async & DOM Q&A
Tech Learn
Search, practise & track Q&A
AI DSA Practice
Solve coding problems
Theme
Home
Kubernetes topics
Lesson 35/ 160
02. Workload Controllers & Scaling

Pod Disruption Budgets (PDBs) for Safe Node Maintenance

Protect availability during drains and voluntary disruptions with PDBs.

IntermediatePDB · minAvailable · Drain Safety3 quiz questions
Practice DevOps Q&A
In plain wordsDiagramTheoryStep by stepWhen to use itInterview cluesMistakes to avoidQuiz (3)Practice

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-data and 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

Loading interactive 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.

Verify minAvailable, not only object creation

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.

Key takeaway: PDB is implemented only when this invariant remains observable: 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.

Recover from minAvailable drift

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.

Key takeaway: Accept the trade-off consciously: PDBs make maintenance safer but transfer operational cost to the maintenance window and require enough replicas and healthy topology.

How it works, step by step

Step 1 of 4
Workload author

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

PDB contract → owned state
Key numbers at this step
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-data in 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-data first: 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

Controller-managed workload
Best for: Protect availability during drains and voluntary disruptions with PDBs. A concrete incident check is 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.

Hand-managed Pods
Best for: Quickly testing the minAvailable assumption with 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.

Progressive-delivery layer
Best for: Teams that need Drain Safety integrated with guardrails; the evidence path is 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-data without 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?
Interview tip: Interview sequence: state the invariant, run 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

Loading quiz

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.

Open DevOps Q&A →Tech Learn Q&A
Previous topic
Cluster Autoscaler vs Karpenter (Dynamic Node Provisioning)
Next topic
PriorityClasses & Pod Preemption