rancher2.5.9 提示证书过期问题

注:前期一定要查看所有日志,rancher报错日志、客户端的rancher-agent、kubectl。。。。。

rancher2.5.9 突然报错,所有的集群无法使用
在这里插入图片描述查看agent日志报错如下
Server certificate is not valid, please check if the host has the correct time configured and if the server certificate has a notAfter date and time in the future. Certificate information is displayed above. error: Get “https://39.1xxxxxxxxxx”: x509: certificate has expired or is not yet valid: current time 2022-09-15T09:38:47Z is after 2022-09-12T11:42:06Z"

怀疑是证书问题
按照网站教程,master时间和nodes时间 均调整为2022-9-12 11:00:00
在这里插入图片描述登录rancher 点击 更新证书后,测试无效,

进入 local-----system中查看密文–证书列表
发现域名、cattle-webhook-tls、serving-cert 证书均过期
想方法更新,
参照rancher官方2.4+版本手动更新命令执行
链接:https://docs.rancher.cn/docs/rancher2/trending-topics/certificate-rotation/_index/
a\ exec 到 rancher server

kubectl --insecure-skip-tls-verify -n kube-system delete secrets k3s-serving
kubectl --insecure-skip-tls-verify delete secret serving-cert -n cattle-system
rm -f /var/lib/rancher/k3s/server/tls/dynamic-cert.json

重启 rancher-server

执行以下命令刷新参数

curl --insecure -sfL https://server-url/v3

重启 Rancher Server 容器
docker restart <rancher_server_id>

===========================
重启后发现还是报错,再次登录rancher----system查看,发现cattle-webhook-tls 还是过期,

在这里插入图片描述点击后面的手动删除此证书,然后重启rancher服务,稍等两分钟后,服务变更为正常

  • 3
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值