Menu

The drain that hangs
📰

The drain that hangs

DEV Community: kubernetes·Aditya gupta·2 days ago
#nKlMEAZk
#devtokubernetes#devto#dev#drain#budget
Reading 0:00
15s threshold

This story was written with the assistance of an AI writing program.

A node drain hangs mid-upgrade. The pods refuse to leave. Is Kubernetes stuck?

A PodDisruptionBudget can be doing exactly what you asked it to.

Kubernetes splits disruptions in two:

Involuntary - node crashes, hardware failures, out-of-resource eviction. A PDB cannot prevent these; they still count against the budget.

Voluntary - kubectl drain, node upgrades, cluster scale-down. Tools that respect budgets go through the eviction API, which checks the PDB first.

A PDB sets minAvailable or maxUnavailable for the pods its selector matches. When evicting one more pod would break the budget, the eviction is rejected and drain keeps retrying until its timeout.

Two catches worth knowing:

Deleting a pod or deployment directly bypasses PDBs completely. Only eviction-API users like drain are checked.

Set maxUnavailable: 0 (or minAvailable equal to your replica count) and drain can't evict any matching pod while the budget stays that tight.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.