k3s 证书过期修改
2023/5/12 21:22:04
本文主要是介绍k3s 证书过期修改,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
作者: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/
这篇关于k3s 证书过期修改的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-05-29银行核心背后的落地工程体系丨混沌测试的场景设计与实战演练
- 2024-05-29多点 Dmall x TiDB:出海多云多活架构下的 TiDB 运维实战
- 2024-05-29KubeKey v3.1 发布:快速自定义离线安装包
- 2024-05-29云原生周刊:Flux 2.3 发布 | 2024.5.20
- 2024-05-29KubeSphere 社区双周报|2024.05.09-05.23
- 2024-05-21DBA体系课项目效果预览
- 2024-05-08见鬼了!我家的 WiFi 只有下雨天才能正常使用...
- 2024-05-081名工程师轻松管理20个工作流,创业企业用Serverless 让数据处理流程提效
- 2024-05-08如何从架构层面降低公有云多可用区同时故障的概率
- 2024-05-08网络隔离的最小配置