Skip to content

Instantly share code, notes, and snippets.

@jodykpw
Last active July 10, 2020 21:39
Show Gist options
  • Save jodykpw/84b17ead3c013c7699f5d491c0f93da9 to your computer and use it in GitHub Desktop.
Save jodykpw/84b17ead3c013c7699f5d491c0f93da9 to your computer and use it in GitHub Desktop.
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/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/kube-audit* /var/log/pods* /var/run/calico*"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -Rf $dir
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment