关于amazon-web-services:k3s-证书过期修改

8次阅读

共计 954 个字符,预计需要花费 3 分钟才能阅读完成。


作者:SRE 运维博客
博客地址:https://www.cnsre.cn/
文章地址:https://www.cnsre.cn/posts/221207116004/
相干话题:https://www.cnsre.cn/tags/k3s/


去年双十一买的服务器,然而创立了 K3S 集群。明天登录的时候发现呈现了以下谬误。简略记录下。

故障景象

登录服务器执行相干命令呈现以下谬误

[root@k3s-master ~]# kubectl get  pods
error: You must be logged in to the server (Unauthorized)

执行 doker 命令判断大略问题

[root@k3s-master ~]#  docker run -it ubuntu  /bin/echo "cnsre"
cnsre

docker 命令能够执行那大概率应该是 k3s 的问题, 查看 k3s 服务日志

[root@k3s-master ~]# journalctl -r -u k3s
1466 authentication.go:63] "Unable to authenticate the request" err="[x509: certificate has expired or is not yet valid: current time

发现有以上谬误,那确定是证书的问题了。

解决办法

对于 K3S 来说解决证书的问题其实很简略。
能够通过重启 K3S 服务的来解决问题

sudo systemctl restart k3s

验证

执行命令验证问题

[root@k3s-master ~]# kubectl get  node
NAME         STATUS     ROLES                  AGE    VERSION
k3s-node1    Ready      <none>                 370d   v1.21.5+k3s2
k3s-node2    Ready      <none>                 370d   v1.21.5+k3s2
k3s-node3    Ready      <none>                 370d   v1.21.5+k3s2
k3s-master   Ready      control-plane,master   370d   v1.21.5+k3s2

问题解决。


作者:SRE 运维博客
博客地址:https://www.cnsre.cn/
文章地址:https://www.cnsre.cn/posts/221207116004/
相干话题:https://www.cnsre.cn/tags/k3s/


正文完
 0