- 清理rancher相关容器
# 停止docker docker stop $(docker ps -q) # 删除 docker rm $(docker ps -aq) # 删除容器存储 docker volume rm $(docker volume ls -q)
- 卸载K8s components和secrets
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/pods \ /var/run/calico
- 重启服务器
reboot