World map

 

BM: Baca dalam Bahasa Melayu

World K5: Lunch Rush

PodDisruptionBudgets

You will learn: how to keep enough trays serving while you empty a stall.

Checked with Kubernetes 1.37 on 31 Oct 2026

The problem

Tonight you fix stall dev-worker. Two of your three shop trays sit there. If both leave at once, one tray serves the whole queue. How do you stop that?

Pick one answer.

Watch

You are here: cluster kind-dev namespace default
The PodDisruptionBudget shop is created: min available 2, allowed disruptions 1. Terminal output: $ kubectl create pdb shop --selector=app=shop --min-available=2 poddisruptionbudget.policy/shop created $ kubectl get pdb shop NAME MIN AVAILABLE MAX UNAVAILABLE ALLOWED DISRUPTIONS AGE shop 2 N/A 1 0s

That rule is a PodDisruptionBudget (PDB): A rule like "at least 2 trays stay up" during planned work, such as a drain. (PDB). --min-available=2 keeps 2 trays up. With 3 ready, ALLOWED DISRUPTIONS is 1: one may leave at a time.

Try it

Build that command yourself. Each piece shows what it means.

Tap the pieces in the right order.

…

Try it

Now empty stall dev-worker. The danger badge shows: a drain moves trays. Watch the budget make one tray wait its turn.

kubectl drain dev-worker --ignore-daemonsets
You are here: cluster kind-dev namespace default
Stalls: 3. Trays: 3 (3 ready). Waiting for a stall: 0.
dev-control-planeOpenManager

No trays here.

dev-workerOpen
  • shop·7tl6k
  • shop·swpd9
dev-worker2Open
  • shop·frd8c
Time: +0s (sped up)

Check

The drain printed: Cannot evict pod as it would violate the pod's disruption budget. What does it mean?

Pick one answer.

Check

A PDB only slows down planned moves. Sort each event.

Drag a card into a box. Or tap the card, then tap the box.

      You did it!

      You can now keep the shop serving while you empty a stall.

      Go deeper (optional)

      Use --max-unavailable instead to say how many may be down. Careful: a budget that allows 0 disruptions blocks every drain forever. After the work, kubectl uncordon dev-worker opens the stall again.

      Real rep (optional): on kind, make a PDB. Then drain a worker and read each line.