Pod Disruption Budget (PDB) is a Kubernetes policy that limits how many matching pods can be voluntarily evicted at the same time. It helps keep enough replicas running during planned operations such as node drains, cluster upgrades, and autoscaler scale-down events.
A PDB protects application availability during controlled Kubernetes maintenance. It tells Kubernetes the minimum level of availability your workload needs before pods can be evicted.
Common voluntary disruptions include:
kubectl drain on a nodeA PDB does not stop involuntary disruptions such as node crashes, kernel panics, hardware failures, or pods being killed because the node runs out of resources.
A PDB uses a label selector to match a group of pods, usually pods managed by a Deployment, StatefulSet, or similar controller. Kubernetes then calculates whether evicting a pod would violate the budget.
You define availability with one of two fields:
minAvailable: the minimum number or percentage of pods that must remain available.maxUnavailable: the maximum number or percentage of pods that may be unavailable.For example, if a service runs 3 replicas and has maxUnavailable: 1, Kubernetes allows only one voluntary eviction at a time. The next eviction must wait until enough pods are ready again.
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: api-pdb
spec:
maxUnavailable: 1
selector:
matchLabels:
app: api
This PDB applies to pods with the label app: api. If the workload has multiple replicas, Kubernetes will allow at most one matching pod to be unavailable due to voluntary eviction.
A replica count says how many pod instances Kubernetes should run. A PDB says how many of those pods must remain available during voluntary disruption.
For example, a Deployment with replicas: 3 creates three pods. A PDB with minAvailable: 2 tells Kubernetes to avoid voluntary actions that would leave fewer than two ready pods.
maxUnavailable: 1 for many stateless services with 3 or more replicas.minAvailable when you know the exact number of pods required to serve traffic safely.