报错截图
解决方法
kubeadm reset
kubeadm reset
清除文件,杀死进程
如果上面的方式做完还是报错,可以采用最笨的办法,杀掉服务的端口,清除init的文件
rm -rf /etc/kubernetes/* # 清除文件
rm -rf ~/.kube/*
rm -rf /var/lib/etcd/*
lsof -i :6443|grep -v "PID"|awk '{print "kill -9",$2}'|sh #杀服务进程
lsof -i :10259|grep -v "PID"|awk '{print "kill -9",$2}'|sh
lsof -i :10257|grep -v "PID"|awk '{print "kill -9",$2}'|sh
lsof -i :10250|grep -v "PID"|awk '{print "kill -9",$2}'|sh
lsof -i :2379|grep -v "PID"|awk '{print "kill -9",$2}'|sh
lsof -i :2380|grep -v "PID"|awk '{print "kill -9",$2}'|sh
重置完毕后这个步骤一定要执行
手动删除 $HOME/.kube
为何要执行这个命令,因为报错了!
Unable to connect to the server: x509: certificate signed by unknown authority (possibly because of "crypto/rsa: verification error" while trying to verify candidate authority certificate "kubernetes")
报错截图如下
所以需要先执行
rm -rf $HOME/.kube
再执行kubenets的正常操作
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config