Pod Disruption Budgets: Stop Upgrades From Killing Your App

A Pod Disruption Budget (PDB) is a contract with Kubernetes to maintain minimum availability. It limits how many pods can be voluntarily terminated at once during node drains or cluster upgrades, preventing self-inflicted outages.
Why it exists
Kubernetes often needs to move pods for maintenance, like upgrading a node's software or decommissioning a machine. Without a safeguard, these "voluntary disruptions" could accidentally take down all pods of a replicated application at once, causing an outage. PDBs were created to prevent this self-inflicted downtime by ensuring a minimum number of pods are always running.
The mental model
Think of a PDB as a service level agreement (SLA) you define for your own application, which Kubernetes must honor. You're telling the cluster administrator and their automation, "You are free to perform maintenance, but you are not allowed to reduce my application's running replica count below this line." It turns availability from a hopeful side effect into a declared, machine-checked requirement.
How it works
You create a PDB resource as a YAML object. In it, you use a label selector to specify which pods it applies to (e.g., all pods with app: my-api). Then you define the budget using either minAvailable (an integer or percentage of pods that must remain) or maxUnavailable (an integer or percentage of pods that can be taken down). When a voluntary disruption occurs, like a node drain, the Kubernetes API server checks if evicting a pod would violate the PDB. If it would, the eviction is rejected until it's safe to proceed.
When to use it
Use PDBs for any production application where high availability is important, especially for stateless services like web servers or APIs running with multiple replicas. They are a core tool for building resilient systems that can survive routine cluster maintenance without impacting users.
When not to use it
Be careful with single-replica applications. Setting a PDB with minAvailable: 1 or maxUnavailable: 0 on a single-pod app will block any node drain, halting cluster maintenance indefinitely. Also, remember PDBs do not help with involuntary disruptions like a node crash, a power outage, or network failure. For that, you need proper replica counts and multi-zone deployments. PDBs are for planned, graceful terminations only.
One canonical example
An API server runs with 5 replicas. The team creates a PDB with minAvailable: 3 for that deployment. A cluster admin drains a node for a kernel upgrade. This node is running 2 of the API server pods. The drain command successfully evicts the first pod. When it tries to evict the second, the API server sees this would leave only 3 pods running (5 total - 1 already evicted - 1 to be evicted = 3). Since 3 is the minAvailable value, the eviction is blocked until another pod for that service starts up on a different node, bringing the available count back up.
Interview question
Which of the following scenarios is a Pod Disruption Budget (PDB) specifically designed to prevent or mitigate?
- a.An application pod failing due to an unhandled exception and restarting.
- b.A node experiencing a sudden hardware failure, causing all its running pods to crash.
- c.A resource quota being exceeded, leading to new pod creation failures.
- d.A Kubernetes cluster upgrade process terminating too many application pods simultaneously.Correct
Why? this is the answer
PDBs are designed to prevent self-inflicted outages during voluntary disruptions, such as those caused by planned cluster maintenance like node drains or upgrades, by ensuring a minimum number of application pods remain available. They do not protect against involuntary disruptions like node crashes or application-specific failures.
Just read this? Test yourself on what you have been reading.
Read the original → kubernetes.io
- #kubernetes
- #k8s
- #availability
- #ops
You just looked this up. Could you explain it out loud?
That is the part interviews actually test. Tezvyn takes questions like this one and gives you what the interviewer is really checking, the answer that lands, and the mistake that ends the conversation, in the four minutes before your next meeting.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on kubernetes — each one lists the topics its interview covers.
See open roles