Centos7 安装k8s

2022/4/5 7:21:40

本文主要是介绍Centos7 安装k8s,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

按照步骤失败后就用kubeadm reset命令重置,后来就好了

安装Kubernetes(k8s)保姆级教程---无坑版

重置Kubernetes

https://www.jianshu.com/p/31f7dda9ccf7

重置命令

sudo kubeadm reset

结果:

W0419 09:34:58.549504    4085 removeetcdmember.go:61] [reset] failed to remove etcd member: etcdserver: re-configuration failed due to not enough started members
.Please manually remove this etcd member using etcdctl
[reset] Stopping the kubelet service
[reset] Unmounting mounted directories in "/var/lib/kubelet"
[reset] Deleting contents of config directories: [/etc/kubernetes/manifests /etc/kubernetes/pki]
[reset] Deleting files: [/etc/kubernetes/admin.conf /etc/kubernetes/kubelet.conf /etc/kubernetes/bootstrap-kubelet.conf /etc/kubernetes/controller-manager.conf /etc/kubernetes/scheduler.conf]
[reset] Deleting contents of stateful directories: [/var/lib/etcd /var/lib/kubelet /var/lib/dockershim /var/run/kubernetes /var/lib/cni]

The reset process does not clean CNI configuration. To do so, you must remove /etc/cni/net.d

The reset process does not reset or clean up iptables rules or IPVS tables.
If you wish to reset iptables, you must do so manually by using the "iptables" command.

If your cluster was setup to utilize IPVS, run ipvsadm --clear (or similar)
to reset your system's IPVS tables.

The reset process does not clean your kubeconfig files and you must remove them manually.
Please, check the contents of the $HOME/.kube/config file.

手工清除:

删除net.d

rm -rf /etc/cni/net.d

重置iptables

iptables -F && iptables -t nat -F && iptables -t mangle -F && iptables -X
sysctl net.bridge.bridge-nf-call-iptables=1

手动执行以下命令来清除对应的残余网卡信息:

sudo ip link del cni0
sudo ip link del flannel.1

删除 $HOME/.kube/config

rm -rf $HOME/.kube/config



这篇关于Centos7 安装k8s的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程