天天看点

rancher2.6.1 x509 证书过期

使用的 rancher出现 Internal error occurred: failed calling webhook "rancherauth.cattle.io": Post "https://rancher-webhook.cattle-system.svc:443/v1/webhook/validation?timeout=10s": x509: certificate has expired or is not yet valid: current time 2022-6-14T04:29:27Z is after 2022-6-13T08:36:41Z  证书问题

Rancher 版本安装了 ​

​rancher-webhook​

​,2.6.1版本创建的证书将在一年后过期。如果证书未续订,你需要轮换你的 webhook 证书。

在 Rancher v2.6.3 及更高版本中,rancher-webhook deployments 将在到期日期后 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​

​​:​

删除 local 集群 cattle-system 命名空间中的 cattle-webhook-tls 密文。

删除 rancher.cattle.io mutating webhook。

删除 local 集群 cattle-system 命名空间中的 rancher-webhook pod。