Kubernetes – Reset Cluster

REF: Stack Overflow

james@server-01:~$ more ~/kube_reset.sh
#!/bin/sh
# https://stackoverflow.com/questions/56850650/reset-kubernetes-cluster
sudo kubeadm reset -f &&
 sudo systemctl stop kubelet &&
 sudo systemctl stop docker &&
 sudo rm -rf /var/lib/cni/ &&
 sudo rm -rf /var/lib/kubelet/* &&
 sudo rm -rf /etc/cni/ &&
 sudo ifconfig cni0 down &&
 sudo ifconfig flannel.1 down &&
 sudo ifconfig docker0 down &&
 sudo ip link delete cni0 &&
 sudo ip link delete flannel.1 &&
 sudo rm -rf /var/lib/etcd/* &&
 sudo rm -fr ~/.kube/* &&
 sudo shutdown -r now