customTLSSecret and customReplicationTLSSecret fields.
How PGO-managed PKI works
When no custom secret is provided, PGO creates and maintains three X.509 artifacts per cluster namespace:
The root CA is stored in a namespace-scoped Secret named
postgres-operator-ca-secret. Each PostgresCluster gets its own leaf certificate (in a separate Secret) with DNS SANs covering the cluster’s primary and replica Services. PGO checks the leaf certificate on every reconciliation and regenerates it when it reaches one-third of its remaining validity period.
One root CA secret is created per namespace. Multiple PostgresCluster resources in the same namespace share that CA, but each cluster gets its own leaf certificate.
Bring your own TLS certificates
To use certificates issued by your own CA, setspec.customTLSSecret on the PostgresCluster. This field is a Kubernetes SecretProjection, which lets you reference a Secret (and optionally remap key names) that PGO will mount at /pgconf/tls inside each PostgreSQL container.
Required secret keys
Your secret must contain exactly these three keys:Creating the TLS secret
1
Generate or obtain your certificates
Produce a server certificate whose Subject Alternative Names include the cluster’s Service DNS names. For a cluster named You also need a separate client certificate for replication.
hippo in the postgres-operator namespace, the primary Service DNS name follows the pattern:2
Create the Kubernetes Secrets
3
Reference the secrets in your PostgresCluster
Using SecretProjection to remap keys
If your existing secret uses different key names, use theitems field of the SecretProjection to remap them without modifying the secret itself:
Rotating certificates
- PGO-managed PKI
- Custom certificates
No action is required. PGO automatically generates a new leaf certificate when the existing one reaches one-third of its remaining lifetime and applies it without cluster downtime.
Related pages
- Create a cluster — end-to-end example including TLS configuration
- PostgresCluster reference — full spec field documentation
- Authentication — configuring pg_hba.conf rules that enforce
hostssl