k8wiz
Playground

Drain a node without breaking a PodDisruptionBudget

Advanced · Kubernetes · about 12 min

worker-1 needs a kernel patch. It runs a Pod of the checkout Deployment, which has 3 replicas and a PodDisruptionBudget.

Loading the playground...

About this scenario

worker-1 needs a kernel patch. It runs a Pod of the checkout Deployment, which has 3 replicas and a PodDisruptionBudget.

kubectl drain uses the Eviction API, which refuses to break a budget. A budget that never allows a disruption blocks every drain.

Objectives

  1. Try to drain worker-1 and see it blocked
  2. Change the budget so one Pod may be disrupted
  3. worker-1 is drained: cordoned, with no checkout Pod on it

What you'll practice

  • Eviction respects PodDisruptionBudgets; deleting a Pod doesn't. That's why drain evicts.
  • minAvailable equal to the replica count means zero allowed disruptions: no node holding one of those Pods can ever be drained.
  • Draining cordons first, so the evicted Pods land on other nodes, or stay Pending if nothing fits.

How the playground works

The cluster runs entirely in your browser: a simulated API server, scheduler, kubelets and controllers, with virtual nodes in three zones. kubectl output follows the real formats, errors use the real messages, and the add-ons (CSI storage, Traefik, Envoy Gateway, cert-manager, Flux, Argo CD) behave like their real counterparts for the common paths. It's a simulation, so some behavior is simplified. Your progress is saved in this browser.

Read next