Skip to content

Instantly share code, notes, and snippets.

@pwilken
Last active November 8, 2019 09:24
Show Gist options
  • Save pwilken/870c5b1544714cef4eaf0f11650ef792 to your computer and use it in GitHub Desktop.
Save pwilken/870c5b1544714cef4eaf0f11650ef792 to your computer and use it in GitHub Desktop.
Rancher/Kubernetes Clean Nodes
#!/bin/sh
docker rmi $(docker images -a -q)
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment