Welcome to the Linux Foundation Forum!

Clean up lab 2.2

Hi, I messed up while running scripts (K8sMaster.sh & K8Second.sh). I want to perform cleanup and restart the whole thing from the beginning (on the same VMs). So I performed 'kubectl delete node ' on master VM and 'kubectl delete node ' on worker VM. When I re ran these scripts, I got bunch of errors. For ex: [ERROR DirAvailable--etc-kubernetes-manifests]: /etc/kubernetes/manifests is not empty [ERROR Port-6443]: Port 6443 is in use etc.....

Is there any cleanup script available?

Comments

  • Hi @pbbhaskar,

    There is a kubeadm reset command that does some cleanup, but in the past it did not remove all the artifacts that were created by the kubeadm init and the kubeadm join commands on the master and worker nodes respectively. The kubectl delete node command only removes the node object from the cluster, otherwise does not cleanup the kubeadm related artifacts.

    You can try a reset then another init and join commands from the lab scripts, but it is not a guaranteed approach for a healthy cluster. I would recommend a fresh start with new VMs, and re-run the 2 shell scripts.

    Regards,
    -Chris

Categories

Upcoming Training