1. 停止 Kubernetes 服务
sudo systemctl stop kubelet
sudo systemctl stop kube-proxy
sudo systemctl stop kube-apiserver
sudo systemctl stop kube-controller-manager
sudo systemctl stop kube-scheduler
2. 重置 Kubernetes 集群
sudo kubeadm reset
3.删除 Kubernetes 包
sudo yum remove -y kubeadm kubelet kubectl kubernetes-cni
4.删除配置文件和数据
sudo rm -rf /etc/kubernetes/
sudo rm -rf /var/lib/etcd/
sudo rm -rf /var/lib/kubelet/
sudo rm -rf $HOME/.kube/
5. 卸载 Docker(如果不再需要)
sudo systemctl stop docker
sudo yum remove -y docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine
sudo rm -rf /var/lib/docker
6.重启
sudo reboot