【发布时间】:2021-07-14 08:24:55
【问题描述】:
我想使用 cert-manager OVH's webhook 来提供 https 通配符证书,但我仍然无法弄清楚为什么 cert-manager 无法访问 OVH 凭据密钥(在 OVH 中创建 DNS 条目所必需的)
ovh-credentials 秘密已在 default 命名空间上创建
证书管理器位于 cert-manager 命名空间中,cert-manager-webhook-ovh 位于 default 命名空间中
我有一个ClusterIssuer,它正在调用cert-manager-webhook-ovh
我已经定义了一个cert-manager-webhook-ovh:secret-reader ClusterRole
以及cert-manager-webhook-ovh 服务帐户和ClusterRole 之间的绑定
cert-manager-webhook-ovh:secret-readerClusterRole
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: cert-manager-webhook-ovh:secret-reader
rules:
- apiGroups: [""]
resources: ["secrets"]
resourceNames: ["ovh-credentials"]
verbs: ["get", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: cert-manager-webhook-ovh:secret-reader
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: cert-manager-webhook-ovh:secret-reader
subjects:
- apiGroup: ""
kind: ServiceAccount
name: cert-manager-webhook-ovh
namespace: cert-manager
这是我的豆荚
➜ alaya-studio git:(main) ✗ kubectl get pods --namespace=cert-manager
NAME READY STATUS RESTARTS AGE
cert-manager-6588898cb4-nfn7p 1/1 Running 1 27d
cert-manager-cainjector-7bcbdbd99f-tgllj 1/1 Running 5 27d
cert-manager-webhook-5fd9f9dd86-csjzq 1/1 Running 0 27d
➜ alaya-studio git:(main) ✗ kubectl get pods
NAME READY STATUS RESTARTS AGE
cert-manager-webhook-ovh-77f9c7cc7b-xfdfx 1/1 Running 4 15d
express-59df84c766-8wjxw 1/1 Running 0 27d
express-59df84c766-l4cf8 1/1 Running 0 27d
express-59df84c766-w6hbt 1/1 Running 0 27d
ngingress-ingress-nginx-controller-5586599f89-5fsgn 1/1 Running 0 28d
创建挑战时出现此错误
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Started 9s cert-manager Challenge scheduled for processing
Warning PresentError 5s (x3 over 7s) cert-manager Error presenting challenge: secrets "ovh-credentials" is forbidden: User "system:serviceaccount:default:cert-manager-webhook-ovh" cannot get resource "secrets" in API group "" in the namespace "cert-manager"
【问题讨论】:
标签: kubernetes webhooks rbac kubernetes-secrets cert-manager