Readd a deleted node to kubernetes
The way to (re)create a node depends on your cluster setup and Kubernetes version.
- kubeadm: run
kubeadm reset
andkubeadm join ...
again on the node (you might need to create a new token if the original one was short-lived, see the linked doc) - most clouds: delete the VM. It will be recreated and will rejoin the cluster
- others: see self registration and manual registration for details.
To add a previously deleted node on kubernetes > 1.8x for me it works restarting kubelet service on the node. It is registering then again in the cluster. But kubernetes has a possibility to make a node "online/offlilne":
> kubectl cordon -h
Mark node as unschedulable.
Examples:
# Mark node "foo" as unschedulable.
kubectl cordon foo
Usage:
kubectl cordon NODE [options]
and
> kubectl uncordon -h
Mark node as schedulable.
Examples:
# Mark node "foo" as schedulable.
$ kubectl uncordon foo
Usage:
kubectl uncordon NODE [options]