I have k8s cluster installed by rke2. There are 3 master and 2 worker node in cluster. Now i am trying to remain first 1 master including package installed. I drain other 4 nodes and delete other 4 nodes. Finally, how to uninstall software completely on 4 node?
1 Answers
As you have already mentioned about a few commands; Please try with the below un-installation method:
Uninstall all the kubernetes packages
Sudo apt-get remove –purge kublet kubeadm kubectl
Remove the configuration files
Sudo rm- rf /etc/kubernetes
Remove the data directory
Sudo rm -rf /ar/lib/kubelet
Remove the kubernetes binaries
Sudo rm -rf /usr/local/bin/kube*
Once these commands have been run on each node, the software should be completely uninstalled. I have taken reference from below pages; fou further information please have a look at How to Delete Pods from a Kubernetes Node by Keilan Jackson, Uninstalling Kubernetes application and How to delete/remove/clean existing corrupted or old kubeadm kubernetes clusters setup by Rajesh Kumar. I am happy to help further if your issue is not resolved.

- 493
- 3
- 11