Situation (Resolved)
I am trying to create a certificate using cert-manager for ovh on kubernetes.
Problem
The challenge created by the certificate shows the following error:
Error presenting challenge: secrets "ovh-credentials" is forbidden: User "system:serviceaccount:default:cert-manager-webhook-ovh-1658181107" cannot get resource "secrets" in API group "" in the namespace "default"
Information
I checked the ovh-credentials existed in the default namespace:
$ kubectl get secret -n default
NAME TYPE DATA AGE
ovh-credentials Opaque 1 22m
Here is my current Certificate:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: altarise-registry-cert # name of the certificate
labels:
app.kubernetes.io/name: altarise-registry-cert # name of the certificate
app.kubernetes.io/tier: backend
app.kubernetes.io/managed-by: Ops
spec:
dnsNames:
- registry.altarise.net # name of the domain you want to validate the certificate
issuerRef:
name: ovh-altarise # name of the issuer you created before
kind: Issuer
secretName: altarise-registry-cert
Resolution
I found out I put the wrong serviceAccount name inside my RoleAccount that gives access to secrets.