k8s node节点重启后遇到的问题及解决

有一个node节点因为主机原因进行了重启,
主机启动之后,通过执行以下命令恢复了节点状态。

systemctl start  docker 
systemctl start kubelet

在主节点查看所有节点都正常,

> kubectl get no 
NAME           STATUS   ROLES    AGE   VERSION
k8s-master01   Ready    master   27d   v1.15.0
k8s-master02   Ready    master   27d   v1.15.0
k8s-master03   Ready    master   27d   v1.15.0
node-01        Ready    <none>   27d   v1.15.0
node-02        Ready    <none>   27d   v1.15.0

但是在重启的主机上执行kubectl get po会报错,get其他资源也会报一样的错。

> kubectl get po -n dev
error: the server doesn't have a resource type "po"
>  kubectl auth can-i get deployments
Warning: the server doesn't have a resource type 'deployments'
Error from server (NotFound): the server could not find the requested resource (post selfsubjectaccessreviews.authorization.k8s.io)

后来发现是~/.kube/http-cache变成空的了,只要在其他节点上拷贝一份即可

 > kubectl auth can-i get deployments
yes

发布了48 篇原创文章 · 获赞 31 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/weixin_44723434/article/details/99678843