Created
May 2, 2020 16:25
-
-
Save leodotcloud/e6d1a81fd86ab2665efef6c2ef1c1b87 to your computer and use it in GitHub Desktop.
Rancher 2.x: Clean up cluster nodes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
# https://rancher.com/docs/rancher/v2.x/en/cluster-admin/cleaning-cluster-nodes/ | |
# sudo -i | |
docker rm -f $(docker ps -qa) | |
docker rmi -f $(docker images -q) | |
docker volume rm $(docker volume ls -q) | |
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/kube-audit \ | |
/var/log/pods \ | |
/var/run/calico | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment