k8s、docker 卸载

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 

你可能感兴趣的:(kubernets,kubernetes,docker,容器)