how to delete all files related to k8s

4/7/2020

I had configured multi master of k8s repeatedly. It looks like the previous configuration of master held still. The pod of calico node didn't work properly.

I want to remove all files of k8s. Could you know how to remove the all files ?

-- canerbis
kubernetes

1 Answer

4/8/2020

Many depends how did you create cluster.

If you used Kubeadm you can use kubeadm reset which will revert of changes made by kubeadm init or kubeadm join.

Beside that you need to delete kubectl, kubeadm, etc. If you instlled it using apt-get (depends on distro. This is example from ubuntu) you can purge them.

$ sudo apt-get purge kubeadm kubectl kube* 

Then use autoremove to get rid out of all dependencies related.

$ sudo apt-get autoremove 

And at the end you should remove rest of config using:

  • $ sudo rm -rf ~/.kube
  • ipvsadm --clear or iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X or similar to clean-up iptables rules

If this won't answer your question, please add more information about your cluster.

-- PjoterS
Source: StackOverflow