World map

 

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

You are here: cluster kind-dev namespace default
kubectl cordon prints node/dev-worker cordoned. kubectl get nodes shows dev-worker as Ready,SchedulingDisabled. Terminal output: $ kubectl cordon dev-worker node/dev-worker cordoned $ kubectl get nodes NAME STATUS ROLES AGE VERSION dev-control-plane Ready control-plane 5m22s v1.37.0 dev-worker Ready,SchedulingDisabled <none> 5m22s v1.37.0 dev-worker2 Ready <none> 5m22s v1.37.0

A 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.

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.

        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·bww25
        • shop·s2gw9
        dev-worker2Open
        • shop·cnnkz
        Time: +0s (sped up)

        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

        1. kubectl create deployment shop --image=nginx:1.29-alpine --replicas=3
        2. kubectl drain <worker-name> --ignore-daemonsets
        3. kubectl get pods -o wide
        4. kubectl uncordon <worker-name>

        0 of 4 steps done · Your ticks are saved.