Troubleshooting·Certified Kubernetes Administrator
Resetting and Rejoining a Node with kubeadm
Take a node out of a cluster and put it back, and take a machine all the way back to bare Ubuntu. Covers what kubeadm reset does not clean up, why removing a node needs two commands rather than one, and the package purge that silently does nothing.
Installation and Cluster Builds Guide 13 of 103 Intermediate
- Kubernetes1.36.4
- Cluster2 nodes
- Runtimecontainerd 2.2.6
- CNICalico v3.32.1
- TimeAbout 30 min
Container and sandbox IDs, timings and package versions are specific to this run.
- Calicov3.32.1
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| CKA3001 | 192.168.0.185 | Ubuntu 26.04 LTS | Control Plane Node | 2 Core | 4 GB | 50 GB |
| CKA3001-NODE01 | 192.168.0.186 | Ubuntu 26.04 LTS | Worker Node (removed and rejoined) | 2 Core | 4 GB | 50 GB |
This guide includes
Use this when a node has to leave a cluster, come back, or be handed on as a clean machine. This matters because removing a node is two separate pieces of state, and the package purge people reach for does nothing at all while the packages are held.
- removing a node properly - drain, delete the Node object, then reset the machine
- reading what
kubeadm resetreports, and expecting noisy StopPodSandbox errors where a CNI was installed - rejoining with a freshly minted token rather than the dead one from
kubeadm init - taking the machine back to bare Ubuntu, including the CNI directories reset leaves behind
- unholding the packages first, because the purge otherwise does nothing, then rebooting - Calico's interfaces outlive them
Before you start
- A cluster with at least one worker you are willing to disturb.
sudoon the node andkubectlaccess to the control plane.- If the node runs anything you care about, somewhere else for it to go. Removing the only worker leaves its pods Pending.
- Know which you want: taking a node out of a cluster is not the same as taking a machine back to bare Ubuntu. The first is two commands, the second is closer to eight.
-
Removing a node takes two commands, not one
-
Reset the machine, and read what it tells you
-
Expect noisy errors during reset on a node that had a CNI
-
Rejoin with a fresh token
-
Going further: back to bare Ubuntu
-
The package purge that silently does nothing
-
Reboot, because interfaces outlive the packages