过期的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-webhook-tls`名称空间中删除`cattle-system`密钥。

  2. 删除`rancher.cattle.io`突变Webhook。

  3. 在本地群集的`rancher-webhook`名称空间中删除`cattle-system` Pod。

Webhook证书过期问题并不特定于示例中列出的`cattle-webhook-tls`。您将相应地填写过期证书的密钥。