k8s node notready

K8S节点状态NotReady问题解决

kubectl get nodes # 发现notready节点

问题描述
 $ kubectl get nodes -o wide |grep NotReady
 $ kubectl describe node [node-ip]
    # Message:  Node xxx which was running pod xxx is unresponsive
# 连接到node节点,并检查各节点服务是否正常
$ ps aux|grep kube-proxy
$ ps aux|grep kubelet
$ ps aux|grep docker
$ ps aux|grep flanneld
 # 检查完后,一切正常。
 
# 此时查看证书是否过期
$ openssl x509 -noout -text -in /xxx/kubelet.crt # 证书路径可根据ps进程中查看cert-dir
证书过期解决
# 删除节点kubelet.kubeconfig及证书生成目录下所有文件(其中包含kubelet.crt)
$ systemctl restart kubelet # 重新生成证书及配置
$ reboot # 重启机器
# 此时还需要重新审批node证书申请,重新加入集群
$ kubectl get csr # 获取csr-id
$ kubectl certificate approve [csr-id]
# 稍等片刻后验证状态是否成功,Pod是否能正常调度。

猜你喜欢

转载自blog.csdn.net/weixin_49689128/article/details/107633002
今日推荐