Sub topic 11
Voluntary and involuntary disruptions
This chapter assumes you know Pods, Deployments, labels and selectors, and that you can use kubectl. It also assumes you know that nodes carry labels and that a cluster can span several availability zones.
Two kinds of disruption
A pod can disappear for many reasons. Kubernetes sorts them into two groups, and the sorting decides which tool can help.
Involuntary disruptions are events nobody asked for:
- A node's hardware fails or its virtual machine is deleted by mistake.
- The kernel panics or the node runs out of memory.
- A cloud zone loses power or network connectivity.
- The node becomes unreachable and the control plane evicts its pods.
Voluntary disruptions are actions that a person or a controller starts on purpose:
- Draining a node for maintenance or a Kubernetes upgrade.
- A cluster autoscaler removing an underused node.
- Deleting a pod's Deployment or changing its template, which triggers a rollout.
- Evicting a pod through the Eviction API.
The cluster operator can usually delay a voluntary disruption. An involuntary one just happens.
What each feature controls
| Feature | Acts on | When it acts |
|---|---|---|
| Topology spread constraints | Pod placement | At scheduling time |
| PodDisruptionBudget | Voluntary evictions | When something asks to evict a pod |
Neither feature prevents involuntary disruptions. Spreading pods limits how many replicas one failure can take down at once. A budget limits how many replicas your own maintenance can take down at once. You usually need both.
A budget does not stop involuntary failures
A PodDisruptionBudget is only checked when a request goes through the Eviction API. A crashed node never makes that request, so the budget cannot stop it. Pods lost this way still reduce the number of healthy replicas. That reduced count is then what the budget uses to decide whether a later eviction is allowed.
Suppose a Deployment has 4 replicas and a budget that needs at least 3 available. A node failure takes out one pod, which leaves 3 available. A drain that tries to evict a second pod is now refused, because it would drop availability to 2.
Not every voluntary action goes through the Eviction API either. Deleting a pod directly with kubectl delete pod skips the budget. Rolling updates are limited by the Deployment's own maxUnavailable and maxSurge settings, not by a PodDisruptionBudget.
Why this matters for design
Plan for the failure you cannot schedule around. If all replicas share one zone, a single zone outage is an involuntary disruption that removes the whole service, and no budget can help. If replicas are spread but have no budget, an administrator draining nodes one after another can still remove too many at once.
Exercise
A node loses power and three pods on it vanish. Does a PodDisruptionBudget stop this? Name one thing that does limit the impact.
Show answer
No. A budget is only consulted when something requests an eviction through the Eviction API, and a power loss is an involuntary disruption. Topology spread constraints limit the impact, because they place replicas on different nodes and zones so that one failure removes only some of them.