k8s卸载

k8s 重置

kubeadm reset -f

如果kubernets是1.24以上版本,请先单独卸载containerd

sudo apt purge containerd.io

k8s软件卸载

ubuntu

#apt卸载
apt purge kubelet kubeadm kubectl

centos

yum erase -y kubelet kubectl kubeadm 

删除kubelet相关信息,可以自行去删除,这个命令可能会误删

find / -name kube* -delete

docker卸载

杀死容器,删除容器

docker kill $(docker ps -a -q)
docker rm $(docker ps -a -q)

删除镜像

docker rmi -f $(docker images -q)

停止docker

systemctl stop docker

卸载Docker Engine、CLI、containerd和Docker Compose软件包
ubuntu

sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-ce-rootless-extras

centos

sudo yum remove docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

删除存储目录

rm -rf /etc/docker /run/docker /var/lib/dockershim /var/lib/docker /var/lib/containerd /usr/bin/docker-init /usr/bin/docker-proxy /usr/bin/dockerd 
Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐