K8s by Example: Pod Disruption Budgets
| PDBs protect against voluntary disruptions: node drains, cluster upgrades, autoscaler scale-downs. Ensures minimum availability during maintenance operations. |
| pdb.yaml | |
| PDBs use the | |
| pdb-options.yaml | |
|
| |
| terminal | |
| PDBs only protect against voluntary disruptions like drains (first command shows PDB blocking eviction). They can’t prevent involuntary disruptions: node failures, OOMKill, crashes. | |
| deployment-pdb.yaml | |
| Match PDB to your replica count. Don’t set minAvailable equal to replicas or drains will hang forever. Leave room for at least one Pod to be disrupted. | |
| pdb-unhealthy.yaml | |
|
| |
| terminal | |
| PDB status shows allowed disruptions and current Pod count. | |
| deployment-pdb-strategy.yaml | |
| During rolling updates, PDB interacts with Deployment strategy. Both constraints must be satisfied. Can cause slow rollouts if both are too restrictive. | |
| terminal | |
| Debug PDB issues by checking allowed disruptions and eviction events. Force drain bypasses PDB but risks availability. Use | |