K8S以及ETCD删除Shell , Docker / containerd 镜像清除
K8S/ETCD清理
·
如果 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)
更多推荐
已为社区贡献14条内容
所有评论(0)