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.
Related Products
on GumroadDeveloper Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →AI Prompt Engineering Toolkit
58 structured prompt templates for Claude, ChatGPT, and Gemini — organized by use case. Code Review, Debugging, Documentation, Architecture, and 10 model-specific tips. Stop writing prompts from scratch.
Buy on Gumroad →Developer Cheat Sheet Bundle
10 print-ready cheat sheets for the tools developers use every day: Git, Docker, Linux CLI, SQL, Regex, HTTP Status codes, VS Code shortcuts, Bash scripting, jq/JSON, and Markdown.
Buy on Gumroad →You Might Also Need
JSON Formatter & Validator
Format, beautify, and validate JSON online. Paste your JSON to instantly pretty-print it with 2-space, 4-space, or tab indentation. Minify JSON too. Free, runs in your browser.
Open free tool →
Regex Tester
Free regex tester. Test regular expressions against multiple strings with expected match/no-match assertions — see instant pass/fail results. Built-in presets for email, URL, IPv4, and phone. Pro: unl
Open free tool →
Base64 Encoder & Decoder
Free Base64 Encoder & Decoder. Convert text, images, and any file to Base64 and back. Supports URL-safe Base64, image data URIs, and file download from Base64. Runs 100% in your browser — no data sent
Open free tool →
More Free Tools
Related Articles
curl 深度使用手冊:API 測試從入門到進階
curl 是每位開發者必備的 CLI 工具。本文涵蓋 GET/POST/PUT/DELETE 請求、認證、header 設定、檔案上傳、除錯技巧,以及 REST API 測試的完整實戰範例。
Best AI Code Review Tools 2026: CodeRabbit, Sourcery, DeepCode & Bito Compared
Compare top AI code review tools for 2026: CodeRabbit, Sourcery, DeepCode, and Bito. Features, pricing, GitHub/GitLab integration, and choosing the right tool for your team.
AI Code Review Tools 2026: GitHub Copilot, CodeRabbit, Qodo Merge Ranked
Compare AI code review tools for 2026: GitHub Copilot code review, CodeRabbit, Qodo Merge, Sourcery, and PR-Agent. Pricing, accuracy, and GitHub integration.
AI Coding Tools Comparison 2026: GitHub Copilot vs Cursor vs Windsurf vs Cline
Comprehensive comparison of the best AI coding tools in 2026: GitHub Copilot, Cursor, Windsurf, and Cline. Pricing, features, model support, and real-world benchmarks.
AI Pair Programming in 2026: GitHub Copilot vs Cursor vs Claude Code
Master AI pair programming in 2026. Compare GitHub Copilot, Cursor, and Claude Code for autocomplete, chat, and agentic workflows. Includes setup guides and productivity tips.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$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.
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: 2 | At least 2 pods must be Available | Quorum-sensitive workloads | Max 3 pods can be disrupted |
| minAvailable: "60%" | At least 60% of pods must be Available | HPA-scaled workloads | At least 3 pods Available (floor 3.0) |
| maxUnavailable: 1 | At most 1 pod can be Unavailable | Slow drain, high-availability | 4 pods must be Available |
| maxUnavailable: "20%" | At most 20% can be Unavailable | Flexible with replica changes | At most 1 pod down (ceil 1.0) |
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.maxUnavailable | Deployment spec | Pods down during image rollout |
| spec.minAvailable / maxUnavailable | PodDisruptionBudget | Pods 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.