Rancher服务cattle-webhook-tls证书过期,更具论坛删除cattle-webhook-tls证书无法自己生成该证书。


该证书过期,根据论坛我去到rancher容器内执行了
kubectl delete secrets -n cattle-system cattle-webhook-tls
kubectl delete pod -n cattle-system rancher-webhook-7fcf457ff9-98b9
但是cattle-webhook-tls 这个证书没有自动创建

官网说是删除后会自动创建服务恢复正常的。
更改用户权限报错

报错:Internal error occurred: failed calling webhook “rancherauth.cattle.io”: Post “https://rancher-webhook.cattle-system.svc:443/v1/webhook/validation?timeout=10s”: dial tcp 10.43.16.175:443: connect: connection refused
困好几天了,求救

你在哪里看到的文档?
这里显示的步骤,和你执行的完全不同:Rancher Docs: Rotation of Expired Webhook Certificates

我最先是执行的这三条命令,就是你发的链接这个,没生成cattle-webhook-tls。我这两条命是在一个论坛里看到的,他们说有用,但我这边还是没效果

看一下 rancher-webhook Pod有没有被正常创建,以及它的日志,寻找线索。

rancher-webhook Pod一直报这个错 time=“2022-08-18T05:50:49Z” level=info msg=“Waiting for server to become available: the server has asked for the client to provide credentials” 网上也没找到什么线索

看一下这个issue:https://github.com/rancher/rancher/issues/35068
你应该中间有一些额外操作,影响了恢复过程,反馈的信息有限无法判断。
这个issue里面的方法,都可以尝试一下。

我也看过这个帖子,之前是根据这个帖子来操作的。 太奇怪了。。

敢问你这个问题有修复吗

你看看上面那个 issue,有轮换 webhook 证书的操作步骤

webhook的证书是最新的 k3s有如下日志 117 authentication.go:53] Unable to authenticate the request due to an error: [invalid bearer token, square/go-jose: error in cryptographic primitive]

  1. 你的现象是什么
    2.你是如何确定 webhook 证书是最新的