Q: You want to implement pod disruption budgets across your cluster. What is a PDB and how does it protect your services?
A PodDisruptionBudget (PDB) limits how many pods of a deployment can be voluntarily disrupted at the same time. "Voluntary disruption" includes node drains, rolling updates, and cluster upgrades.
Want to master this scenario in a live sandbox? KodeKloud's CKA & CKAD Hands-On Certification Track covers this exact problem with hands-on terminal drills.
🛠️ Production Runbook & Step-by-Step Resolution
Direct Answer: "In our production Kubernetes clusters running microservices on EKS/AKS, this was a classic operational challenge. When addressing this question, I walk the interviewer through our production incident runbook: isolating the blast radius, checking diagnostic logs and metrics, and applying a safe fix."
Initial Diagnostics & Root Cause Analysis
A PodDisruptionBudget (PDB) limits how many pods of a deployment can be voluntarily disrupted at the same time. "Voluntary disruption" includes node drains, rolling updates, and cluster upgrades.
minAvailable: 2— at least 2 pods must remain.maxUnavailable: 1— at most 1 pod can be down at a time.
Remediation & Permanent Safeguards
Example: This says: "When draining a node, don't proceed if it would bring my-app below 2 running pods." Use: During a cluster upgrade when nodes are drained, without PDBs your entire deployment could go down if all pods happen to be on the nodes being drained.
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: my-app-pdb
spec:
minAvailable: 2
selector:
matchLabels:
app: my-app
- minAvailable: 2 — at least 2 pods must remain.
- maxUnavailable: 1 — at most 1 pod can be down at a time.
Senior hiring managers and bar raisers evaluate how you prioritize during outages. Avoid these common anti-patterns:
- Attempting multi-minor Kubernetes version jumps directly during cluster upgrades Kubernetes explicitly does not support multi-minor version jumps; control plane and worker components require sequential hops to validate API deprecations.
- Upgrading kube-apiserver while leaving critical cluster add-ons and CNI plugins desynchronized Upgrading kube-apiserver without synchronizing CNI daemonsets or CoreDNS manifests causes silent pod networking failure and DNS timeouts immediately post-upgrade.
- Replacing worker node pools simultaneously rather than adopting sequential rolling node group updates In-place or simultaneous node pool replacements risk cluster-wide capacity starvation if new AMIs or kubelet versions encounter bootstrapping errors.
- Overlooking terminationGracePeriodSeconds when evicting stateful database or queue consumer pods in kubernetes-q045-you-want-to-implement-pod-disruptio Prematurely terminating stateful pods before in-flight transactions commit causes data corruption and unclean lock releases.