Skip to content

[Feature]: Add duration and renewBefore to the clientCertificate stanza on DatabaseRole #11312

Description

@gbartolini

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?

#10809 added operator-managed TLS client certificates for declarative roles via the clientCertificate.enabled field on DatabaseRole. The lifetime and renewal window of those certificates are currently taken unconditionally from the operator's global settings (CERTIFICATE_DURATION, default 90 days, and EXPIRING_CHECK_THRESHOLD, default 7 days), the same values used for the operator's own internal PKI.

There is no way to give a role's client certificate a different lifetime or renewal window from the cluster-wide default. This matters for cert-auth roles in particular: a role used by a short-lived automation job may want a much shorter-lived certificate than a long-running application role, and some environments have compliance requirements around client credential lifetime that don't necessarily match the operator's internal certificate policy.

Describe the solution you'd like

Extend the clientCertificate stanza on DatabaseRole with two optional fields, mirroring the duration / renewBefore convention already familiar from cert-manager:

clientCertificate:
  enabled: true
  duration: 2160h      # 90 days, defaults to the operator's CertificateDuration setting
  renewBefore: 168h     # 7 days, defaults to the operator's ExpiringCheckThreshold setting
  • clientCertificate.duration: overrides the certificate lifetime for this role only. Falls back to the operator-wide CertificateDuration when unset.
  • clientCertificate.renewBefore: overrides how long before expiry the operator renews the certificate for this role. Falls back to the operator-wide ExpiringCheckThreshold when unset. Should be validated as strictly less than duration at the webhook.
  • Reflect the effective duration in status.clientCertificate (already exposes expiration) so users can confirm the override took effect without decoding the certificate.

Describe alternatives you've considered

  • Leave duration/renewal tied to the operator-wide settings (forces all cert-auth roles across all clusters onto one policy, which doesn't fit mixed workloads).
  • A separate CertificateTemplate-style CRD referenced by clientCertificate: more flexible but disproportionate for two scalar fields; can be revisited if more knobs (key algorithm, usages) are requested later.

Additional context

Follows #10809

Backport?

No

Are you willing to actively contribute to this feature?

Yes

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. added this to the 1.31.0 milestone on Aug 12, 2026
  2. self-assigned this
    on Aug 12, 2026
  3. added
    enhancement 🪄
    on Aug 12, 2026
  4. added 7 commits that reference this issue on Aug 21, 2026
    a4297e4
    8d4d5e3
    02bf59f
  5. added 2 commits that reference this issue on Sep 4, 2026
    753dab4
    d3d7e67
  6. added a commit that references this issue on Sep 24, 2026
    5fd92c6
  7. added a commit that references this issue on Oct 23, 2026
    7b9227c
  8. added a commit that references this issue on Nov 2, 2026
    a77201d
  9. added a commit that references this issue on Nov 2, 2026
    357fb9f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement 🪄

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions