kubernetes
Kubernetes PodDisruptionBudget Generator
Generate a Kubernetes PodDisruptionBudget YAML to protect your workloads during node drains, rolling updates, and cluster upgrades.
Kubernetes PodDisruptionBudgets
PDBs prevent voluntary disruptions from causing downtime. They're essential for production workloads.
Without a PDB
kubectl drain node-1 → all 3 pods evicted at once → downtimeWith minAvailable: 1
kubectl drain node-1 → evict pod-1 → wait for new pod to be ready
→ evict pod-2 → wait... → no downtimePercentage-Based Policy
spec:
maxUnavailable: 34% # for a 3-pod deployment: floor(3 × 0.34) = 1 podCheck PDB Status
kubectl get pdb -n default
# Output:
# NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE
# my-app-pdb 1 N/A 2 5dALLOWED DISRUPTIONS = current_replicas - minAvailable
If ALLOWED DISRUPTIONS = 0, no voluntary evictions are permitted — you have exactly minAvailable pods running.
PDB for StatefulSets
spec:
minAvailable: 2 # for a 3-node cluster: never go below quorum
selector:
matchLabels:
app: my-dbKey Terms
Full glossary →kubeadm
A tool for bootstrapping Kubernetes clusters. It automates the setup of control plane components and joining worker nodes, following Kubernetes best practices.
etcd
A distributed key-value store used by Kubernetes to store all cluster state and configuration. etcd is the single source of truth for the entire cluster.
cert-manager
A Kubernetes controller for automating TLS certificate management. cert-manager can issue certificates from Let's Encrypt, Vault, or internal CAs, and automatically renews them.
Helm
A package manager for Kubernetes. Helm charts bundle Kubernetes manifests into reusable packages with configurable values, versioned and published to chart repositories.
Frequently Asked Questions
What is a PodDisruptionBudget?
A PDB limits how many pods of a workload can be voluntarily disrupted at the same time. 'Voluntary' means: node drains (kubectl drain), rolling updates, cluster upgrades, node pool scaling. Involuntary disruptions (node crash, OOM kill) are NOT limited by PDBs. A PDB with minAvailable: 1 tells Kubernetes: 'never voluntarily take down all pods, always keep at least 1 running.'
minAvailable vs maxUnavailable — which should I use?
minAvailable is more intuitive: 'keep at least N pods running'. Use it when you know how many pods you need alive. maxUnavailable is the inverse: 'allow at most N pods down simultaneously'. It's more natural for percentage-based policies. Example: minAvailable: 1 is equivalent to maxUnavailable: replicas-1. For a 3-replica Deployment, minAvailable: 2 = maxUnavailable: 1.
Does a PDB block kubectl drain?
Yes — if draining a node would violate the PDB, kubectl drain will block and wait. The node drain succeeds only when pods can be safely evicted without breaking the budget. This is the whole point of PDBs. If drain gets stuck, check: kubectl get pdb -n <namespace> to see which PDB is blocking and how many pods are currently available.
Should I add a PDB to every Deployment?
Yes for any production workload with multiple replicas. Without a PDB, a rolling cluster upgrade or node drain can take down all replicas simultaneously if they happen to be on the same nodes. The generated PDB with minAvailable: 1 is the minimum useful config — for critical services, use minAvailable: 2 or a percentage like 50%.
Related Calculators
Related Guides
kubernetes
CI/CD for Kubernetes with GitHub Actions: A Complete Guide (2026)
A practical walkthrough of building a full GitHub Actions pipeline that builds a container image, pushes it to a registry, and deploys to Kubernetes — with secrets handling, rollback, and Helm support.
kubernetes
ArgoCD vs Flux: Choosing a GitOps Tool for Kubernetes in 2026
A no-fluff comparison of ArgoCD and Flux for GitOps on Kubernetes — covering architecture, UI, Helm support, multi-tenancy, and when to pick each one.
kubernetes
Hetzner vs DigitalOcean for Kubernetes in 2026: An Honest Comparison
Hetzner is 3–5× cheaper than DigitalOcean for equivalent Kubernetes compute. But DO has managed K8s, better global coverage, and a larger app marketplace. Here's when each is the right choice.