4

I've dead node which I probably removed using kubectl instead of microk8s command. The problem is that microk8s status still shows it among datastore standby nodes. How can it be deleted from the cluster?

microk8s remove-node 192.168.1.3 --force
Error from server (NotFound): nodes "192.168.1.3" not found
Node 192.168.1.3 does not exist in Kubernetes.

Is it safe to remove the node from /var/snap/microk8s/current/var/kubernetes/backend/cluster.yaml ?

2 Answers2

6

On the (slave) node that you want remove from the cluster run:

microk8s leave

on the master node:

find the name of the node that you want to remove from the cluster:

microk8s.kubectl get nodes

then:

microk8s remove-node <name-of-the-node>
qwertz
  • 871
1

Finally it seems that works:

  1. Adding a new node with the same name using microk8s join
  2. This node is broken (microk8s is not running)
  3. Remove the node from cluster by running microk8s leave at the node itself
  4. If needed, the node with the same name can be added again and works