最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

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

IT培训 admin 3浏览 0评论

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

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
发布评论

评论列表 (0)

  1. 暂无评论