Repository navigation
Description
Is there an existing issue already for this feature request/idea?
- I have searched for an existing issue, and could not find anything. I believe this is a new feature request to be evaluated.
What problem is this feature going to solve? Why should it be added?
CloudNativePG currently exposes a single operator-wide CERTIFICATE_DURATION that applies equally to self-managed CAs and leaf certificates. As a result, the cluster CA rotates on the same cadence as server, replication, and client leaf certificates. This increases the frequency of trust-anchor rotation even though CA certificates are typically expected to be longer lived than leaves.
The current shared-duration model creates operational coupling in the reconciliation flow:
- CA rotation is treated as a routine event rather than a comparatively rare one.
- Leaf certificate re-issuance paths must handle CA churn, especially for
DatabaseRoleclient certificates. - Operator-to-instance and instance-to-instance trust transitions become more frequent than necessary.
- Recent bug reports such as [Bug]: CA certificate rotation creates deadlock — operator cannot restart pods due to x509 verification failure #10433 show that CA rotation can have cluster-wide consequences when pods still serve certificates chained to the previous CA.
There is no clear documented rationale in code comments, issue #1691, or PR #3686 for keeping CA and leaf lifetimes identical. The code appears to have adopted a single shared knob as an implementation simplification rather than an explicit PKI design decision.
Allowing the CA to have a separate lifetime would reduce unnecessary CA rotation while preserving short-lived leaf certificates and the current automated renewal model.
Describe the solution you'd like
Introduce distinct duration settings:
CA_CERTIFICATE_DURATION: lifetime of generated root/derived CA certificatesCERTIFICATE_DURATION: lifetime of generated non-CA certificates (preserve existing meaning for leaf certificates)
Compatibility and migration:
- Preserve backward compatibility by keeping current behavior when
CA_CERTIFICATE_DURATIONis unset. - If only
CERTIFICATE_DURATIONis set, behavior remains exactly as today. - If
CA_CERTIFICATE_DURATIONis set, self-managed CA certificates should use that value while leaf certificates continue to useCERTIFICATE_DURATION. - Existing clusters should continue to reconcile safely without requiring users to recreate secrets.
Describe alternatives you've considered
Switch to user-provided certificates e.g. maintained by Cert-Manager.
Additional context
I've researched and partly created this issue with help of AI.
Backport?
Yes
Are you willing to actively contribute to this feature?
Yes
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsBacklog
Activity
baurmatt commentedon Jul 5, 2026
@Utkarsh-sharma47 Was your commented meant for another issue? I fail to see the connection to my feature request.
Utkarsh-sharma47 commentedon Jul 5, 2026
Sorry, that comment was intended for a different issue . I posted it here by mistake.