Skip to content

Instantly share code, notes, and snippets.

@leodotcloud
Last active March 18, 2022 02:32
Show Gist options
  • Save leodotcloud/f4f8920c4cc045fefe04b75062668dfe to your computer and use it in GitHub Desktop.
Save leodotcloud/f4f8920c4cc045fefe04b75062668dfe to your computer and use it in GitHub Desktop.
Cleanup 2.x cluster node for reuse
docker rm -f $(docker ps -qa)
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