K8s 集群总是安装失败,记录k8s卸载方式

Docker

1.查看docker状态

systemctl status docker

2.停止docker
如果docker是运行状态,先停调docker。

 systemctl stop docker

3.查看yum安装的docker文件包

 yum list installed |grep docker

删除所有安装的docker文件包

yum -y remove xxx

在这里插入图片描述

yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-selinux \
docker-engine-selinux \
docker-engine
 
rm -rf /etc/systemd/system/docker.service.d
rm -rf /var/lib/docker
rm -rf /var/run/docker

彻底卸载k8s(重置k8s)

转至

1、停止相关服务

systemctl stop kubelet 
systemctl stop etcd 
systemctl stop docker

2、卸载k8s

kubeadm reset -f

3、删除k8s相关目录

modprobe -r ipip
lsmod
rm -rf ~/.kube/
rm -rf /etc/kubernetes/
rm -rf /etc/systemd/system/kubelet.service.d
rm -rf /etc/systemd/system/kubelet.service
rm -rf /usr/bin/kube*
rm -rf /etc/cni
rm -rf /opt/cni
rm -rf /var/lib/etcd
rm -rf /var/etcd

4、卸载k8s相关程序

yum -y remove kube*

5、更新镜像

yum clean all
yum -y update
yum makecache
Logo

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

更多推荐