reset kubernetes

  sudo kubeadm reset

clean up docker


  docker rm -f $(docker ps -qa)
  docker volume rm $(docker volume ls -q)

clean kubernetes dirs

  cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico /opt/rke"
  for dir in $cleanupdirs; do
      echo "Removing $dir"
      rm -rf $dir
  done

remove .kube if necessary bash sudo rm -rf ~/.kube

clean up routing tables

  sudo iptables -F
  sudo iptables -t nat -F
  sudo iptables -t mangle -F
  sudo iptables -X