Skip to content
This repository has been archived by the owner on Sep 16, 2024. It is now read-only.

BKM: Properly Reset Kubernetes for Rejoining or Re installation

xwu2 edited this page Jul 4, 2020 · 2 revisions

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-*