Skip to content

Instantly share code, notes, and snippets.

@pax-k
Forked from Ileriayo/nuke_rancher_kube_node.sh
Created August 28, 2020 08:31
Show Gist options
  • Save pax-k/35188932a66ba4cf36f1e948aff15ddc to your computer and use it in GitHub Desktop.
Save pax-k/35188932a66ba4cf36f1e948aff15ddc to your computer and use it in GitHub Desktop.

Revisions

  1. @Ileriayo Ileriayo created this gist Aug 5, 2020.
    27 changes: 27 additions & 0 deletions nuke_rancher_kube_node.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,27 @@
    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


    sudo reboot