在某天需要發布新版本的時候,發現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/