Take a node out of service

  • 12 min
  • 6 steps
  • Scheduling and nodes

Steps

0 of 6 done

Read a Node object, cordon it, and drain it past the three kinds of pod that kubectl drain refuses by default.

  1. Step 1 of 6

    Show everything the API knows about kx-worker2: its conditions, its capacity and allocatable resources, and the Lease its kubelet renews.

    Checked against what your commands print.

  2. Step 2, not started: List every pod bound to kx-worker2, in every namespace, so you know what a drain will have to move.

  3. Step 3, not started: Stop the scheduler from placing any more pods on kx-worker2 without touching the pods already running there.

  4. Step 4, not started: Drain kx-worker2. A plain drain refuses three kinds of pod; read its error, decide what each override gives up, and drain again until it reports the node drained. The web Deployment must end with three ready replicas.

  5. Step 5, not started: List the pods on kx-worker2 again. Only the node agents run by DaemonSets should be left.

  6. Step 6, not started: Maintenance is done. Let the scheduler use kx-worker2 again.

Lab terminal

Cluster time 50 seconds
kind cluster kx, Kubernetes 1.37.
Each step is checked as you work.
​
Tab completes. Up and Down recall.
Type help for more.
Terminal keys

Enter runs the command. Tab completes, and the arrow keys recall earlier commands. Control C stops a watch. On an empty line, or after Escape, Tab moves focus out of the terminal.