Description:
We already have cert-manager deployed and working in our clusters using SmallStep CA as an issuer. Works fine for us. I installed the psmdb-operator with little to no changes to its default values.
I try to install a psmdb-db with its helm chart and get an error because the operator tries to create a CA cert that is already controlled by our own CA(SmallStep).
Not sure what the proper approach is here. We only want certificates on our clusters that are signed by our own CA and we know get renewed based on our needs and wants.
Is there some way to use the certificates generated by certManager from our CA?
If we generate internal and external certifcates prior to deploying a MongoDB statefulset with the psmdb-db helm chart. Can we just tell it to use the existing certificates by passing it the appropriate secrets?
Steps to Reproduce:
I am using both the psmdb-operator and the psmdb-db Helm charts. Both version 1.19.0.
psmdb-operator
- replicaCount: 3 in values file
- watchAllNamespaces: true
psmdb-db
I did a deploy with backup and sharding disabled. I then tried setting the below TLS values but got the same result.
- tls.mode: allowTLS
- tls.issuerConf.name: step-cluster-issuer
- tls.issuerConf.kind: StepClusterIssuer
- tls.issuerConf.group: certmanager.step.sm
The name, kind and group values are ussually what we set when on the issuerRef whenever we want a certificate issued. So I figured I would give it a try…
Logs:
TLS secrets handler: "create ssl by cert-manager: update cert mangager certs: failed to apply cert-manager certificates: failed to wait for ca cert: set controller reference: Object percona/first-psmdb-psmdb-db-ca-cert is already owned by another Certificate controller first-psmdb-psmdb-db-ca-cert". Please create your TLS secret first-psmdb-psmdb-db-ssl manually or setup cert-manager correctly
Expected Result:
Valid certificates, generated by certManager with our CA as the issuer, for internal
and external communication.
MongoDB StatefulSet, Pods, Services, etc are created.
Actual Result:
Certificates get created but the PerconaServerMongoDB kind is stuck in an error state with the above error message. No PODS are ever created.
apiVersion: v1
data:
ca.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JS....
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1J...
tls.key: LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tL...
kind: Secret
metadata:
annotations:
cert-manager.io/alt-names: ""
cert-manager.io/certificate-name: first-psmdb-psmdb-db-ca-cert
cert-manager.io/common-name: first-psmdb-psmdb-db-ca
cert-manager.io/ip-sans: ""
cert-manager.io/issuer-group: ""
cert-manager.io/issuer-kind: Issuer
cert-manager.io/issuer-name: first-psmdb-psmdb-db-psmdb-ca-issuer
cert-manager.io/uri-sans: ""
creationTimestamp: "2025-01-24T10:37:40Z"
labels:
controller.cert-manager.io/fao: "true"
name: first-psmdb-psmdb-db-ca-cert
namespace: percona
ownerReferences:
- apiVersion: cert-manager.io/v1
blockOwnerDeletion: true
controller: true
kind: Certificate
name: first-psmdb-psmdb-db-ca-cert
uid: 588823e5-b309-4233-bbe9-e41770ecf7dd
resourceVersion: "351676508"
uid: 0ecae70c-ec25-4e3c-8643-869fc3e57606
type: kubernetes.io/tls
Additional Information:
…