PodDisruptionBudgets: The Five Lines That Save Your Upgrade
Most AKS upgrade outages aren't upgrade bugs. They're a missing PodDisruptionBudget: five lines of YAML standing between a rolling node drain and all your replicas dying at once.
Most AKS upgrade outages aren't upgrade bugs. They're a missing PodDisruptionBudget: five lines of YAML standing between a rolling node drain and all your replicas dying at once.
Here's an outage that happens constantly and is almost entirely preventable. A team runs an AKS upgrade. Nodes drain in sequence, evicting pods to reschedule them. On one node sit all three replicas of a service. The drain evicts all three at once. For the seconds it takes them to come back elsewhere, the service is simply down, during a maintenance window the team thought was safe.
The thing that would have prevented it is a PodDisruptionBudget, and it's about five lines:
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: my-service
spec:
minAvailable: 2
selector:
matchLabels:
app: my-service
A PDB governs voluntary disruptions: the planned evictions from node drains during upgrades and scale-down. It tells Kubernetes: "you may take pods from this app, but never drop below this many available." The drain then respects it, evicting pods a few at a time and waiting for replacements to come up before taking more. Your rolling node upgrade becomes a genuinely rolling pod restart.
Two things worth saying plainly:
minAvailable equal to your
replica count means no pod can ever be evicted, and your upgrade hangs forever.
Leave headroom: if you run three, allow one to move.Every workload that runs more than one replica and that you'd notice going down deserves a PDB. It's the cheapest reliability you'll ever buy in AKS: five lines that turn "we took an outage during a routine upgrade" into a sentence you never have to write.
Want this distilled for your stack? Ask the assistant for the key takeaways or related reading.
Keep reading
Kubernetes versions age out on a schedule, and AKS only supports a rolling window. Fall off the back of it and you're running unsupported infrastructure under production, usually discovered at the worst moment.
Sathpal-OS