← Back to list

Kubernetes Pod Disruption Budget (PDB)

Pod Disruption Budget is a kubernetes policy object that limits the number of pods of a replicated application to be available at any…

naveen reddy · 2025-10-09 19:05 · 0 claps · 1.2 min read
#kubernetes #pdb #pod-disruption-budget #kubernetes-node-upgrade #pdb-blocking-the-drain
Open on Medium ↗
Wiki topics: ☁️ · DevOps & Cloud

Kubernetes Pod Disruption Budget (PDB)

Pod Disruption Budget is a kubernetes policy object that limits the number of pods of a replicated application to be available at any instance of time.

What exactly is PDB and why we need it?

For an example if we implement the PDB for an Application and defined Minimum Available pods is 7 then during any voluntary disruption (like draining node while upgrade, manual pod deletions, cluster autoscaler removing nodes) the PDB will pause the pod deletions based on our declaration.

PDB does not work on any involuntary disruption (like scaling down the application, node crashes, forceful shutdowns, cloud provider terminating node unexpectedly) because all these are out of kubernetes control.

How to implement the PDB ?

apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: python-app-pdb
spec:
  minAvailable: 3
  selector:
    matchLabels:
      app: python-app

Here, I created a PDB for my app named and labeled as python-app and which means at least 3 pods should be available all the time. In the similar way we can also declare using maxUnavaible pods, which means maximum no of pods can be unavailable at any time.

Best Practices

Always define PDBs for critical workloads (e.g., web servers, databases).

Use minAvailable for stateful apps (e.g., databases).

Use maxUnavailable for stateless apps (e.g., web frontends).

Monitor PDBs using kubectl get pdb.

Note

Too strict PDBs can block node upgrades or autoscaling.

No PDBs can lead to service downtime during maintenance.

Misconfigured selectors may not match any pods, making the PDB ineffective.

Happy Learning :)


메타데이터
post_id
ff19da764952
slug
kubernetes-pod-disruption-budget-pdb-ff19da764952
url
https://medium.com/@naveenreddy1335/kubernetes-pod-disruption-budget-pdb-ff19da764952
canonical_url
https://medium.com/@naveenreddy1335/kubernetes-pod-disruption-budget-pdb-ff19da764952
author_url
https://medium.com/@naveenreddy1335
status
ok
fetched_at
2026-06-21 07:44:09