Hi @Tomislav_Plavcic, unfortunately, v. 1.16.1. does not work as expected.
How I tested:
- scaled down operator + mongodb
- delete secrets psmdb-db-ssl, psmdb-db-ssl-internal
- replaced certificates with my
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: psmdb-db-ssl
namespace: psmdb
spec:
secretName: psmdb-db-ssl
issuerRef:
name: vault-issuer-mongo-server
subject:
organizations:
- MYORG
organizationalUnits:
- cloud
commonName: psmdb-db-rs0
dnsNames:
- "localhost"
- "psmdb-db-rs0"
- "psmdb-db-rs0.psmdb"
- "psmdb-db-rs0.psmdb.svc.cluster.local"
- "*.psmdb-db-rs0"
- "*.psmdb-db-rs0.psmdb"
- "*.psmdb-db-rs0.psmdb.svc.cluster.local"
- "psmdb-db-mongos"
- "psmdb-db-mongos.psmdb"
- "psmdb-db-mongos.psmdb.svc.cluster.local"
- "*.psmdb-db-mongos"
- "*.psmdb-db-mongos.psmdb"
- "*.psmdb-db-mongos.psmdb.svc.cluster.local"
- "psmdb-db-cfg"
- "psmdb-db-cfg.psmdb"
- "psmdb-db-cfg.psmdb.svc.cluster.local"
- "*.psmdb-db-cfg"
- "*.psmdb-db-cfg.psmdb"
- "*.psmdb-db-cfg.psmdb.svc.cluster.local"
---
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: psmdb-db-ssl-internal
namespace: psmdb
spec:
secretName: psmdb-db-ssl-internal
issuerRef:
name: vault-issuer-mongo-server
commonName: psmdb-db-rs0
subject:
organizations:
- MYORG
organizationalUnits:
- cloud
dnsNames:
- localhost
- psmdb-db-rs0
- psmdb-db-rs0.psmdb
- psmdb-db-rs0.psmdb.svc.cluster.local
- "*.psmdb-db-rs0"
- "*.psmdb-db-rs0.psmdb"
- "*.psmdb-db-rs0.psmdb.svc.cluster.local"
- psmdb-db-mongos
- psmdb-db-mongos.psmdb
- psmdb-db-mongos.psmdb.svc.cluster.local
- "*.psmdb-db-mongos"
- "*.psmdb-db-mongos.psmdb"
- "*.psmdb-db-mongos.psmdb.svc.cluster.local"
- psmdb-db-cfg
- psmdb-db-cfg.psmdb
- psmdb-db-cfg.psmdb.svc.cluster.local
- "*.psmdb-db-cfg"
- "*.psmdb-db-cfg.psmdb"
- "*.psmdb-db-cfg.psmdb.svc.cluster.local"
- after this, cert-manager has created new secrets psmdb-db-ssl, psmdb-db-ssl-internal as expected
apiVersion: v1
kind: Secret
metadata:
name: psmdb-db-ssl
namespace: psmdb
uid: 6fc271fb-e1fa-47f6-9bcd-473fe257c9cf
resourceVersion: '361155'
creationTimestamp: '2024-06-17T08:38:45Z'
labels:
controller.cert-manager.io/fao: 'true'
annotations:
cert-manager.io/alt-names: >-
localhost,psmdb-db-rs0,psmdb-db-rs0.psmdb,psmdb-db-rs0.psmdb.svc.cluster.local,*.psmdb-db-rs0,*.psmdb-db-rs0.psmdb,*.psmdb-db-rs0.psmdb.svc.cluster.local,psmdb-db-mongos,psmdb-db-mongos.psmdb,psmdb-db-mongos.psmdb.svc.cluster.local,*.psmdb-db-mongos,*.psmdb-db-mongos.psmdb,*.psmdb-db-mongos.psmdb.svc.cluster.local,psmdb-db-cfg,psmdb-db-cfg.psmdb,psmdb-db-cfg.psmdb.svc.cluster.local,*.psmdb-db-cfg,*.psmdb-db-cfg.psmdb,*.psmdb-db-cfg.psmdb.svc.cluster.local
cert-manager.io/certificate-name: psmdb-db-ssl
cert-manager.io/common-name: psmdb-db-rs0
cert-manager.io/ip-sans: ''
cert-manager.io/issuer-group: ''
cert-manager.io/issuer-kind: ''
cert-manager.io/issuer-name: vault-issuer-mongo-server
cert-manager.io/subject-organizationalunits: cloud
cert-manager.io/subject-organizations: MYORG
cert-manager.io/uri-sans: ''
managedFields:
...
- operator is scaled up
- operator overwrites Certificates and rewrites Secrets…
2024-06-17T08:41:05.612Z INFO setup Manager starting up {"gitCommit": "8790e85f0fe68be30f7ff1ce737f2322beddbc9a", "gitBranch": "release-1-16-1", "goVersion": "go1.22.4", "os": "linux", "arch": "amd64"}
2024-06-17T08:41:05.636Z INFO server version {"platform": "kubernetes", "version": "v1.30.1"}
2024-06-17T08:41:05.648Z INFO controller-runtime.metrics Starting metrics server
2024-06-17T08:41:05.648Z INFO starting server {"name": "health probe", "addr": "[::]:8081"}
2024-06-17T08:41:05.648Z INFO controller-runtime.metrics Serving metrics server {"bindAddress": ":8080", "secure": false}
I0617 08:41:05.648847 1 leaderelection.go:250] attempting to acquire leader lease psmdb/08db0feb.percona.com...
I0617 08:41:23.448927 1 leaderelection.go:260] successfully acquired lease psmdb/08db0feb.percona.com
2024-06-17T08:41:23.449Z INFO Starting EventSource {"controller": "psmdb-controller", "source": "kind source: *v1.PerconaServerMongoDB"}
2024-06-17T08:41:23.449Z INFO Starting Controller {"controller": "psmdb-controller"}
2024-06-17T08:41:23.449Z INFO Starting EventSource {"controller": "psmdbrestore-controller", "source": "kind source: *v1.PerconaServerMongoDBRestore"}
2024-06-17T08:41:23.449Z INFO Starting EventSource {"controller": "psmdbbackup-controller", "source": "kind source: *v1.PerconaServerMongoDBBackup"}
2024-06-17T08:41:23.449Z INFO Starting EventSource {"controller": "psmdbrestore-controller", "source": "kind source: *v1.Pod"}
2024-06-17T08:41:23.449Z INFO Starting EventSource {"controller": "psmdbbackup-controller", "source": "kind source: *v1.Pod"}
2024-06-17T08:41:23.449Z INFO Starting Controller {"controller": "psmdbrestore-controller"}
2024-06-17T08:41:23.449Z INFO Starting Controller {"controller": "psmdbbackup-controller"}
2024-06-17T08:41:23.580Z INFO Starting workers {"controller": "psmdbrestore-controller", "worker count": 1}
2024-06-17T08:41:23.590Z INFO Starting workers {"controller": "psmdbbackup-controller", "worker count": 1}
2024-06-17T08:41:23.600Z INFO Starting workers {"controller": "psmdb-controller", "worker count": 1}
2024-06-17T08:41:23.773Z INFO createSSLByCertManager updating cert-manager certificates {"controller": "psmdb-controller", "object": {"name":"psmdb-db","namespace":"psmdb"}, "namespace": "psmdb", "name": "psmdb-db", "reconcileID": "523c9a34-9f26-4345-9d39-bacffa68f45d"}
2024-06-17T08:41:23.773Z INFO Creating old secrets {"controller": "psmdb-controller", "object": {"name":"psmdb-db","namespace":"psmdb"}, "namespace": "psmdb", "name": "psmdb-db", "reconcileID": "523c9a34-9f26-4345-9d39-bacffa68f45d"}
2024-06-17T08:41:23.824Z INFO applying new certificates {"controller": "psmdb-controller", "object": {"name":"psmdb-db","namespace":"psmdb"}, "namespace": "psmdb", "name": "psmdb-db", "reconcileID": "523c9a34-9f26-4345-9d39-bacffa68f45d"}
2024-06-17T08:41:26.003Z INFO migrating new ca {"controller": "psmdb-controller", "object": {"name":"psmdb-db","namespace":"psmdb"}, "namespace": "psmdb", "name": "psmdb-db", "reconcileID": "523c9a34-9f26-4345-9d39-bacffa68f45d"}
my PerconaServerMongoDB
secrets:
ssl: psmdb-db-ssl
sslInternal: psmdb-db-ssl-internal
...
tls:
allowInvalidCertificates: false
certValidityDuration: 2160h
issuerConf:
group: cert-manager.io
kind: Issuer
name: vault-issuer-mongo-server
mode: preferTLS
Ideas?