跳至主要内容

過期 Webhook 憑證的輪替

對於已安裝 rancher-webhook 的 Rancher 版本,某些版本建立的憑證將在一年後過期。如果憑證未更新,你將需要輪替你的 webhook 憑證。

在 Rancher v2.6.3 及更高版本中,rancher-webhook 部署將在憑證到期日的 30 天或更少天數內自動更新其 TLS 憑證。如果你使用的是 v2.6.2 或更早版本,有兩種方法可以解決此問題:

1. 具有叢集存取權限的使用者,執行以下命令:​

kubectl delete secret -n cattle-system cattle-webhook-tls
kubectl delete mutatingwebhookconfigurations.admissionregistration.k8s.io --ignore-not-found=true rancher.cattle.io
kubectl delete pod -n cattle-system -l app=rancher-webhook

2. 無法透過 kubectl 存取叢集的使用者:​

  1. 刪除本地叢集的 cattle-system 命名空間中的 cattle-webhook-tls secret。

  2. 刪除 rancher.cattle.io mutating webhook

  3. 刪除本地叢集的 cattle-system 命名空間中的 rancher-webhook pod。

備註

webhook 憑證到期問題並非特定於範例中列出的 cattle-webhook-tls。你將相應地填入你過期的憑證 secret。