BM: Baca dalam Bahasa Melayu
World K9: Cluster Admin
Cordon, drain, uncordon
You will learn: how an admin empties a stall for repairs, and what drain will not move.
Checked with Kubernetes 1.37 on 1 Nov 2026
The problem
Tonight the electrician rewires stall dev-worker. Two shop trays sit there. What do you do before the power goes off?
Pick one answer.
Watch
kind-dev namespace defaultA cordon: The “no new orders” sign on a stall: new trays go elsewhere, old ones stay. is the “no new orders” sign on a stall. New trays go elsewhere. Trays already there keep serving.
Try it
drain: Cordon a stall, then move its trays to other stalls, ready for repairs. puts up the sign, then moves every tray away. Without flags, it stops. Tap the line that names the fix.
Tap the line that names the fix.
0 of 1 found
Plain words: kube-proxy and kindnet live on every stall. They cannot move.
Hint
Look for the words in brackets: “use … to ignore”.Try it
Drain treats trays differently. Sort them.
Drag a card into a box. Or tap the card, then tap the box.
Try it
Empty stall dev-worker for the electrician. A drain moves trays, so the danger badge shows.
kind-dev namespace defaultdev-control-planeOpenManagerNo trays here.
dev-workerOpen- shop·bww25
- shop·s2gw9
dev-worker2Open- shop·cnnkz
Hint
kubectl drain dev-worker --ignore-daemonsets. Then let the clock run.Predict
Repairs done. You type kubectl uncordon dev-worker. Where do the two moved trays go?
Pick one answer.
Check
Put a stall’s repair night in order.
First step at the top. Put these in order. Use the arrows, or drag.
- Repair the stall
- kubectl drain dev-worker --ignore-daemonsets
- kubectl get pdb -A (any budgets?)
- kubectl uncordon dev-worker
- kubectl get nodes (Ready, no SchedulingDisabled)
You did it!
You can now empty a stall for repairs and open it again.
Go deeper (optional)
Trays with an emptyDir need --delete-emptydir-data: that scratch data is lost. A PodDisruptionBudget makes drain wait its turn (K5). Drain cordons first, even when it then stops.
Real mission
kubectl create deployment shop --image=nginx:1.29-alpine --replicas=3kubectl drain <worker-name> --ignore-daemonsetskubectl get pods -o widekubectl uncordon <worker-name>
0 of 4 steps done · Your ticks are saved.
Bahasa Melayu
Malam ini juruelektrik pasang wayar baharu di gerai dev-worker. Dua dulang shop ada di situ. Apa anda buat sebelum elektrik dipadam?
Cordon ialah papan “tiada pesanan baharu” pada gerai. Dulang baharu pergi ke tempat lain. Dulang yang sudah ada terus melayan.
Drain pasang papan itu, kemudian pindah semua dulang. Tanpa flag, ia berhenti. Ketik baris yang sebut caranya.
Maksudnya: kube-proxy dan kindnet ada di setiap gerai. Ia tak boleh pindah.
Drain layan dulang dengan cara berbeza. Susun ikut kumpulan.
Kosongkan gerai dev-worker untuk juruelektrik. Drain pindahkan dulang, jadi lencana bahaya muncul.
kubectl drain dev-worker --ignore-daemonsets. Kemudian biar jam berjalan.Kerja baiki siap. Anda taip kubectl uncordon dev-worker. Ke mana dua dulang yang dipindah itu pergi?
Susun malam membaiki gerai ikut urutan.
Kini anda boleh kosongkan gerai untuk dibaiki dan buka semula.
You finished this before. Practice is always welcome!
Official docs: Kubernetes: safely drain a node · kubectl drain · kubectl cordon
You've learned for 25 minutes. A short break helps your brain.
Sprint done! Great focus. Stretch for a minute?