Rancher无法登录 容器报错X509:certificate has expired or is not ye valid
在某天需要发布新版本的时候,发现rancher无法登录,于是到服务器上查看rancher日志,发现以下内容:
参考rancher文档中独立容器Rancher Server证书更新解决
1. 进入容器 <rancher_server_id>为容器id
docker exec -it <rancher_server_id> /bin/bash
2.容器内操作
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
exit
3.重启容器
docker restart <rancher_server_id>
4.执行以下参数刷新参数,并再次重启容器 <server-url> 为rancher登录地址
curl --insecure -sfL https://<server-url>/v3
文档链接:https://docs.rancher.cn/docs/rancher2/cluster-admin/certificate-rotation/_index/