for kube_svc in${KUBE_SVC}; do # 停止服务 if [[ `systemctl is-active ${kube_svc}` == 'active' ]]; then systemctl stop ${kube_svc} fi # 禁止服务开机启动 if [[ `systemctl is-enabled ${kube_svc}` == 'enabled' ]]; then systemctl disable${kube_svc} fi done
# 停止所有容器 docker stop $(docker ps -aq)
# 删除所有容器 docker rm -f $(docker ps -qa)
# 删除所有容器卷 docker volume rm $(docker volume ls -q)
# 卸载 mount 目录 for mount in $(mount | grep tmpfs | grep '/var/lib/kubelet' | awk '{ print $3 }') /var/lib/kubelet /var/lib/rancher; do umount $mount; done