K8S v1.18.x 部署-Kubeadm方式-6:重置集群

K8S v1.18.x 部署-Kubeadm方式-6:重置集群,第1张

概述重置集群如果安装过程中出现问题,无论是Master节点还是Worker节点,都可以执行kubeadmreset命令进行重置:[root@K8S-TEST-M1kubernetes]#kubeadmreset[reset]Readingconfigurationfromthecluster...[reset]FYI:Youcanlookatthisconfigfilewith'kubectl-nkube

重置集群
如果安装过程中出现问题, 无论是Master节点还是Worker节点, 都可以执行kubeadm reset命令进行重置:

[root@K8S-TEST-M1 kubernetes]# kubeadm reset
[reset] Reading configuration from the cluster...
[reset] FYI: You can look at this config file with 'kubectl -n kube-system get cm kubeadm-config -oyaml'
[reset] WARNING: Changes made to this host by 'kubeadm init' or 'kubeadm join' will be reverted.

[preflight] Running pre-flight checks
[reset] Removing info for node "k8s-test-m1" from the ConfigMap "kubeadm-config" in the "kube-system" namespace
{"level":"warn","ts":"2020-07-09T17:41:54.061+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:41:54.117+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:41:54.239+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:41:54.460+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:41:54.946+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:41:55.846+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:41:57.672+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:42:00.938+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:42:07.510+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:42:20.455+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
{"level":"warn","ts":"2020-07-09T17:42:46.865+0800","caller":"clIEntv3/retry_interceptor.go:61","msg":"retrying of unary invoker Failed","target":"endpoint://clIEnt-30fb2f52-f866-462a-9cee-f7fe87cef67d/192.168.122.61:2379","attempt":0,"error":"rpc error: code = UnkNown desc = etcdserver: re-configuration Failed due to not enough started members"}
W0709 17:42:46.867820 30317 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.
清除CNI配置
rm -rf /etc/cni/net.d
清除iptables

下面命令谨慎 *** 作,清除iptables

iptables -F
iptables -X

然后重启节点

清除IPVS配置
ipvsadm --clear
清除kubeconfig
rm -f $HOME/.kube/config
清除日志
rm -f /var/log/kube-audit/*

总结

以上是内存溢出为你收集整理的K8S v1.18.x 部署-Kubeadm方式-6:重置集群全部内容,希望文章能够帮你解决K8S v1.18.x 部署-Kubeadm方式-6:重置集群所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1244635.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-07
下一篇 2022-06-07

发表评论

登录后才能评论

评论列表(0条)

保存