使用docker方式安装的Rancher 2.x集群在执行完后,会在宿主机上生成一些文件。删除镜像时,在执行
docker rm rancher
时,不会删除生成的文件,会导致重装rancher集群不成功
可不操作,直接命令行删除容器也行
# 停止
docker stop $(docker ps -q)
# 删除
docker rm $(docker ps -aq)
# 删除容器存储
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/pods \
/var/run/calico
reboot