How do you handle customer PDBs that block node drains?

November 25, 2026 5 answers
Asked by 4j!marblebinder_681

We host Kubernetes clusters where customers can create their own workloads and PodDisruptionBudgets. Some setups block drains during patching, and we want to catch problems without treating every zero-disruption budget as a mistake. How do you handle this?

Answers

7a+gobletlathe_425

I'd start with Kyverno in audit mode and send the findings to the teams that own the workloads. That gives them a chance to fix problematic budgets before you decide whether to enforce anything.

Checks for maxUnavailable set to 0 and minAvailable set to 100% are a useful start. Give teams a documented exception path too, since some workloads really do need special handling during maintenance.

4j!marblebinder_681:

Audit first sounds useful. We need a way to distinguish intentional restrictions from budgets that were set without maintenance in mind.

Reply to this answer
q.839+plendori

Admission checks only catch part of this. A budget with minAvailable set to 1 can be fine for a workload with several healthy replicas, but it blocks eviction when there is only one. A normally reasonable budget can also have zero allowed disruptions while pods are unhealthy.

Alongside any creation-time warning, check PDB status before a maintenance window. For example, kubectl get pdb -A shows allowed disruptions. Treat zero as something to investigate, not proof that the spec is wrong.

Reply to this answer
Zorvilo+5c

If you want warnings without running a policy webhook, consider a ValidatingAdmissionPolicy for the obvious PDB settings. On supported Kubernetes versions, a binding can use Warn and Audit actions to flag them without rejecting the request.

That still won't tell you whether the workload will be drainable on patch day. It's a useful early warning, not a replacement for checking actual PDB status.

Reply to this answer
c.827+vordeli

Make a blocked drain an explicit maintenance outcome. Stop or pause the rollout, report which cluster and workload need attention, and ask the owner to resolve it before retrying. That is less intrusive than overriding customer availability settings by default.

If you do offer a timeout followed by forced pod removal, make the disruption risk and authorization clear ahead of time. That should be a conscious service decision, not a surprise during patching.

Reply to this answer
Frankie

I'd keep database workloads out of a blanket fix until you've checked their operator's maintenance procedure. A CloudNativePG primary can make a zero-disruption result look alarming even when the restriction is intentional. Look into its maintenance options and agree on a plan with the workload owner.

Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions