Skip to content

Instantly share code, notes, and snippets.

@bgulla
Created July 29, 2019 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bgulla/6f38c1841de8ebb87e69010c18f71b69 to your computer and use it in GitHub Desktop.
Save bgulla/6f38c1841de8ebb87e69010c18f71b69 to your computer and use it in GitHub Desktop.
Removes rancher from a host
docker rm -f $(docker ps -qa)
docker rmi -f $(docker images -q)
docker volume rm $(docker volume ls -q)
sleep 1
for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done
rm -rf /etc/ceph \
/etc/cni \
/etc/kubernetes \
/opt/cni \
/opt/rke \
/run/secrets/kubernetes.io \
/run/calico \
/run/flannel \
/var/lib/calico \
/var/lib/etcd \
/var/lib/cni \
/var/lib/kubelet \
/var/lib/rancher/rke/log \
/var/log/containers \
/var/log/pods \
/var/run/calico
echo "rebooting in 5 seconds"
sleep 5
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment