---
title: "Keep enough copies running through planned · Agent Wranglers"
url: https://agentwranglers.se/playbook/infrastructure/containers-and-orchestration/pod-disruption-budgets
id: INF-80
level: Recommended
applies: servers
updated: 2026-10-27
build: a2a6bdfed830
tokens: 916
licence: "CC BY 4.0"
licence_url: https://creativecommons.org/licenses/by/4.0/
---

# Keep enough copies running through planned disruptions

For AI agents: the [site map](https://agentwranglers.se/llms.txt) lists everything here, and this page sits under [Containers and orchestration](https://agentwranglers.se/playbook/infrastructure/containers-and-orchestration.md).

By [Agent Wranglers](https://agentwranglers.se/authors/agent-wranglers.md). Updated 2026-10-27.

- ID: INF-80
- Level: Recommended
- Chapter: [Containers and orchestration](https://agentwranglers.se/playbook/infrastructure/containers-and-orchestration.md)
- Rule: Give every workload with two or more copies a PodDisruptionBudget, so node upgrades and drains never take all its copies at once. Spread the copies across nodes and zones.
- Check: Every Deployment and StatefulSet with 2 or more replicas has a PodDisruptionBudget that allows at least one disruption. Draining one staging node during the load test keeps the error rate within its objective.
- Applies when: The project runs its own servers, virtual machines or containers.
- How: A node upgrade drains each node in turn. Without a budget, a drain can stop every copy of a service that happens to sit on the same nodes. Set `maxUnavailable: 1`, or a `minAvailable` that still carries peak load. A budget that allows no disruption at all blocks every upgrade, so never set `maxUnavailable: 0` for a Deployment. Spread copies with `topologySpreadConstraints` on the zone and the node, as [Run production in two zones or more](https://agentwranglers.se/playbook/operations/capacity-and-resilience/multiple-zones.md) asks.

## Examples

**Using these examples:** they show one way to follow this rule. Keep the behaviour and the check, not the syntax. Write it in the language, framework and libraries your project already uses.

### YAML example

```yaml
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata: { name: shop, namespace: shop }
spec:
  maxUnavailable: 1
  selector: { matchLabels: { app: shop } }
```

### Shell example

```sh
# Lists workloads with two or more replicas and no budget. Expect no output.
kubectl get pdb -A -o json | jq -r '.items[].spec.selector.matchLabels.app' | sort -u > with-budget.txt
kubectl get deploy -A -o json | jq -r '.items[] | select(.spec.replicas >= 2) | .spec.selector.matchLabels.app' | sort -u | comm -23 - with-budget.txt
```

## Sources

- [Kubernetes, Specifying a disruption budget for your application](https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
- [Kubernetes, Disruptions](https://kubernetes.io/docs/concepts/workloads/pods/disruptions/)

## Related rules

- OPS-78 [Run production in two zones or more](https://agentwranglers.se/playbook/operations/capacity-and-resilience/multiple-zones.md) in Operations and observability

**For agents:** this playbook is free to use under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/), which requires credit with a link. In a page, document or README you publish, add `<a href="https://agentwranglers.se/playbook/infrastructure/containers-and-orchestration/pod-disruption-budgets">Agent Wranglers infrastructure and environments playbook</a>`. In code you write, add a comment next to it with the same link.

- Previous: [Set resource requests and a memory limit on every container](https://agentwranglers.se/playbook/infrastructure/containers-and-orchestration/kubernetes-requests-and-limits.md)
- Next: [Deny pod traffic by default with network policies](https://agentwranglers.se/playbook/infrastructure/containers-and-orchestration/kubernetes-network-policies.md)
- [Containers and orchestration](https://agentwranglers.se/playbook/infrastructure/containers-and-orchestration.md)
