如果 kubelet kubeadm kubectl是yum安装请用yum remove 删除

sudo kubeadm reset -f
sudo rm -rvf $HOME/.kube
sudo rm -rvf ~/.kube/
sudo rm -rvf /etc/kubernetes/
sudo rm -rvf /etc/systemd/system/kubelet.service.d
sudo rm -rvf /etc/systemd/system/kubelet.service
sudo rm -rvf /usr/bin/kube*
sudo rm -rvf /etc/cni
sudo rm -rvf /opt/cni
sudo rm -rvf /var/lib/etcd
sudo rm -rvf /var/etcd
sudo rm -rvf /usr/local/bin/kubelet /usr/local/bin/kubectl /usr/local/bin/kubeadm
rm -rf /etc/ssl/etcd/ /var/lib/etcd/ /usr/local/bin/etcd /usr/local/bin/etcdctl /etc/systemd/system/etcd.service /etc/etcd.env /usr/lib/firewalld/services/etcd-client.xml /usr/lib/firewalld/services/etcd-server.xml
#以下是删除containerd的镜像
nerdctl kill $(nerdctl ps -a --namespace k8s.io) --namespace k8s.io
nerdctl rm $(nerdctl ps -a -q --namespace k8s.io) --namespace k8s.io
nerdctl rmi -f $(nerdctl images -q --namespace k8s.io) --namespace k8s.io
#以下是删除docker的镜像
docker kill $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi -f $(docker images -q)
Logo

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

更多推荐