BKM: Properly Reset Kubernetes for Rejoining or Re installation - OpenVisualCloud/Dockerfiles GitHub Wiki

For any reason if you have to reset Kubernetes for rejoining a cluster or re-installation, you have to use more than kubeadm reset. The recommended steps are as follows:

kubeadm reset --force

If the above command failed, run the following commands:

rm -rf /etc/kubernetes/*
rm -rf $HOME/.config
kubeadm reset --force

Then:

ip link delete cni0
rm -rf /etc/cni
rm -rf /var/lib/cni

If you use Flannel as the CNI, additionally do the following:

ip link delete flannel.1

If you use WeaveNet as the CNI, additionally do the following:

curl -L git.io/weave -o /usr/local/bin/weave
chmod a+x /usr/local/bin/weave
weave reset
rm -f /opt/cni/bin/weave-*