重新初始化k8s master节点

2020-09-27 16:46:40 浏览数 (1)

卸载k8s, 可以参考这篇文章: https://blog.csdn.net/ccagy/article/details/85845979

一共分为以下几步:

1. 删除/etc/kubernetes/文件夹下的所有文件

2. 删除$HOME/.kube文件夹

3. 删除/var/lib/etcd文件夹

代码语言:javascript复制
rm -rf /etc/kubernetes/*
rm -rf ~/.kube/*
rm -rf /var/lib/etcd/*

4. 停用端口号, 把下面的这些端口号都停用就ok

代码语言:javascript复制
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 :2379|grep -v "PID"|awk '{print "kill -9",$2}'|sh

lsof -i :2380|grep -v "PID"|awk '{print "kill -9",$2}'|sh

0 人点赞