ubuntu卸载k8s
时间: 2023-08-30 18:11:04 浏览: 154
要卸载Kubernetes(k8s)在Ubuntu上,请按照以下步骤:
1. 停止Kubernetes服务:
```
sudo systemctl stop kubelet
sudo systemctl stop docker
```
2. 卸载Kubernetes软件包:
```
sudo apt-get purge kubeadm kubectl kubelet kubernetes-cni
```
3. 删除Kubernetes配置文件:
```
sudo rm -rf /etc/kubernetes
```
4. 删除Kubernetes相关的Docker镜像和容器:
```
docker ps -a | grep k8s | awk '{print $1}' | xargs docker rm -f
docker images | grep k8s | awk '{print $3}' | xargs docker rmi -f
```
5. 确认所有Kubernetes相关的Docker镜像和容器都已删除:
```
docker ps -a | grep k8s
docker images | grep k8s
```
6. 删除Kubernetes相关的网络接口:
```
sudo ip link delete cni0
sudo ip link delete flannel.1
```
7. 确认所有Kubernetes相关的网络接口都已删除:
```
ip link show
```
现在,Kubernetes已从Ubuntu系统中完全卸载。
阅读全文