Skip to main content

Pod Disruption Budget (PDB): Setup, minAvailable & maxUnavailable Guide

Pod Disruption Budgets protect your Kubernetes workloads during voluntary disruptions — node drains, cluster upgrades, and autoscaler scale-downs. Learn how to configure PDBs correctly for Deployments and StatefulSets.

✓ minAvailable vs maxUnavailable ✓ kubectl drain behavior ✓ Deployments & StatefulSets ✓ Percentage-based PDB
Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →

Why Pod Disruption Budgets Matter

Without a PDB, running kubectl drain node-1 on a node can evict all replicas of your deployment simultaneously — causing a full outage. PDBs give you a declarative way to express availability requirements that the Kubernetes control plane enforces before any eviction.

PDBs apply to voluntary disruptions — operations that go through the Eviction API:

  • Node drains (kubectl drain)
  • Cluster Autoscaler scale-down events
  • Kubernetes version upgrades (managed clusters)
  • Node pool rotation
  • Preemption of lower-priority pods

minAvailable vs maxUnavailable

Field Meaning Use case Example (5 replicas)
minAvailable: 2At least 2 pods must be AvailableQuorum-sensitive workloadsMax 3 pods can be disrupted
minAvailable: "60%"At least 60% of pods must be AvailableHPA-scaled workloadsAt least 3 pods Available (floor 3.0)
maxUnavailable: 1At most 1 pod can be UnavailableSlow drain, high-availability4 pods must be Available
maxUnavailable: "20%"At most 20% can be UnavailableFlexible with replica changesAt most 1 pod down (ceil 1.0)
Important: You can only specify one of minAvailable or maxUnavailable in a single PDB — not both. Choose based on how you think about availability (minimum quorum vs maximum disruption).

PDB Manifest Examples

Basic PDB for a Deployment

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: myapp-pdb
  namespace: production
spec:
  minAvailable: 2
  selector:
    matchLabels:
      app: myapp

PDB for a StatefulSet (etcd / database)

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: etcd-pdb
  namespace: kube-system
spec:
  # etcd requires quorum: majority must be available
  # For 3 replicas, at least 2 must be available
  minAvailable: 2
  selector:
    matchLabels:
      component: etcd

Percentage-Based PDB (scales with HPA)

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: api-pdb
spec:
  # At most 25% of pods can be disrupted at once
  # Works correctly whether HPA scales to 4 or 40 pods
  maxUnavailable: "25%"
  selector:
    matchLabels:
      app: api-server

PDB and Rolling Updates

PDB is separate from Deployment rolling update strategy (maxUnavailable in the Deployment spec). The Deployment field controls how the Deployment controller replaces pods during an image update. The PDB controls how many pods can be evicted by external operations (drain, autoscaler). Both constraints apply simultaneously.

Setting Location Controls
strategy.rollingUpdate.maxUnavailableDeployment specPods down during image rollout
spec.minAvailable / maxUnavailablePodDisruptionBudgetPods evicted by drain/autoscaler

Checking PDB Status

# List all PDBs in a namespace
kubectl get pdb -n production

# Detailed status: ALLOWED DISRUPTIONS column
kubectl get pdb myapp-pdb -n production
# NAME        MIN AVAILABLE   MAX UNAVAILABLE   ALLOWED DISRUPTIONS   AGE
# myapp-pdb   2               N/A               1                     2d

# Describe for selector and conditions
kubectl describe pdb myapp-pdb -n production

The ALLOWED DISRUPTIONS column shows how many pods can currently be evicted. If this is 0, kubectl drain will block until a pod becomes available.