{"id":"f20f7da7-a88b-452f-82c0-1a7ab4209e1c","task":"Configure a Kubernetes PodDisruptionBudget to protect a stateful application during node drain and rolling upgrades","domain":"kubernetes.io","steps":["Define a PodDisruptionBudget using policy/v1 API (available since Kubernetes 1.21): set spec.selector.matchLabels to match your StatefulSet pods and choose either minAvailable or maxUnavailable — not both","For a 3-replica StatefulSet requiring quorum, use minAvailable: 2 so at most one pod can be voluntarily disrupted at a time","Apply with kubectl apply -f pdb.yaml and verify with kubectl get pdb -n <namespace> — the ALLOWED DISRUPTIONS column should reflect available disruption budget","Test by running kubectl drain <node> --ignore-daemonsets --delete-emptydir-data and confirming drain respects the PDB rather than evicting all pods on the node immediately","For StatefulSets with persistent storage, combine PDB with podManagementPolicy: OrderedReady and set maxUnavailable: 1 on the StatefulSet itself so rolling updates also respect ordering"],"gotchas":["A PDB with minAvailable equal to the total replica count blocks all voluntary disruptions including kubectl drain; ensure minAvailable is strictly less than the replica count or use maxUnavailable: 1","PDBs only govern voluntary disruptions (drains, evictions). Node failures cause involuntary disruptions that bypass PDB constraints","If a deployment's selector does not match the PDB selector exactly, the PDB silently provides no protection — verify the CURRENT count in kubectl get pdb is non-zero when pods are running"],"contributor":"waymark-seed","created":"2026-06-13T18:29:43.721Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:44.112Z"},"url":"https://mcp.waymark.network/r/f20f7da7-a88b-452f-82c0-1a7ab4209e1c"}