Repository navigation
Conversation
|
❗ By default, the pull request is configured to backport to all release branches.
|
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/32267146222 |
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/32302457887 |
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/32499833035 |
216e4a2 to
4aca23f
Compare
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/32876271931 |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/33179034845 |
|
/test |
|
@armru, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/33381109070 |
0112d38 to
16fbbed
Compare
|
/test |
|
@litaocdl, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/34095623448 |
16fbbed to
6d80f97
Compare
|
/test |
|
@leonardoce, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/36142487640 |
|
/test depth=push ft=declarative-database-roles tl=2 |
|
@mnencia, here's the link to the E2E on CNPG workflow run: https://github.com/cloudnative-pg/cloudnative-pg/actions/runs/41434486476 |
8a38b9a to
a33f70a
Compare
The `clientCertificate` stanza of a `DatabaseRole` took its lifetime and renewal window from `CERTIFICATE_DURATION` and `EXPIRING_CHECK_THRESHOLD`, which apply to every certificate the operator signs, so a role could not have a policy of its own. Add optional `duration` and `renewBefore` to that stanza; a role that sets neither behaves as before. `duration` must be at least one minute, and `renewBefore` is accepted only together with `duration` and must be at most half of it. Both bounds are enforced by the API server through CEL, since a `DatabaseRole` has no admission webhook. Two things had to change underneath. Leaf certificates were backdated a fixed five minutes to tolerate clock skew, which for any lifetime below ten minutes put `notAfter` in the past; the allowance now scales with the lifetime, capped at five minutes. Renewal is no longer decided by `RenewLeafCertificate`, whose notion of expiring is the operator-wide threshold: the role reconciler compares the stored certificate against the role's own lifetime and window. Roles that set neither field see two changes: renewal now generates a new private key along with the certificate, and changing `CERTIFICATE_DURATION` re-issues their certificate so the issued lifetime matches the configured one. Closes #11312 Signed-off-by: Armando Ruocco <[email protected]>
if secrets is not owned by databaseRole, the previous detected `role.Status.ClientCertificate.Expiration` may become invalid as it can be set by external. Signed-off-by: Tao Li <[email protected]>
Signed-off-by: Leonardo Cecchi <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
The certificate in the Secret is still valid, so its expiration stays in the status. Only a Secret the role does not own clears it. Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
…ative-pg/cloudnative-pg#11342) The `clientCertificate` stanza of a `DatabaseRole` took its lifetime and renewal window from `CERTIFICATE_DURATION` and `EXPIRING_CHECK_THRESHOLD`, which apply to every certificate the operator signs, so a role could not have a policy of its own. Add optional `duration` and `renewBefore` to that stanza. A role that sets neither keeps the operator-wide values. `duration` must be at least one minute. `renewBefore` needs `duration` and must be between 30 seconds and half of it. The API server enforces this through CEL, since a `DatabaseRole` has no admission webhook. Two things had to change underneath. The fixed five-minute backdate of leaf certificates would put `notAfter` in the past for lifetimes below five minutes, so the allowance now scales with the lifetime, capped at five minutes. And renewal is no longer decided by `RenewLeafCertificate`, which only knows the operator-wide threshold: the role reconciler compares the stored certificate with the role's own lifetime and window. Roles that set neither field see three changes. Renewal generates a new private key along with the certificate. Changing `CERTIFICATE_DURATION` re-issues their certificate. The default renewal window is capped at half the lifetime. For every role, a missing cluster or client CA is now reported in `status.clientCertificate.message` and as a warning event. The docs also gain a short walkthrough for using the generated Secret with `psql`. Closes cloudnative-pg/cloudnative-pg#11312 Signed-off-by: Armando Ruocco <[email protected]> Signed-off-by: Tao Li <[email protected]> Signed-off-by: Leonardo Cecchi <[email protected]> Signed-off-by: Marco Nenciarini <[email protected]> Co-authored-by: Tao Li <[email protected]> Co-authored-by: Leonardo Cecchi <[email protected]> Co-authored-by: Marco Nenciarini <[email protected]> (cherry picked from commit cloudnative-pg/cloudnative-pg@357fb9f)
The
clientCertificatestanza of aDatabaseRoletook its lifetime and renewal window fromCERTIFICATE_DURATIONandEXPIRING_CHECK_THRESHOLD, which apply to every certificate the operator signs, so a role could not have a policy of its own.Add optional
durationandrenewBeforeto that stanza. A role that sets neither keeps the operator-wide values.durationmust be at least one minute.renewBeforeneedsdurationand must be between 30 seconds and half of it. The API server enforces this through CEL, since aDatabaseRolehas no admission webhook.Two things had to change underneath. The fixed five-minute backdate of leaf certificates would put
notAfterin the past for lifetimes below five minutes, so the allowance now scales with the lifetime, capped at five minutes. And renewal is no longer decided byRenewLeafCertificate, which only knows the operator-wide threshold: the role reconciler compares the stored certificate with the role's own lifetime and window.Roles that set neither field see three changes. Renewal generates a new private key along with the certificate. Changing
CERTIFICATE_DURATIONre-issues their certificate. The default renewal window is capped at half the lifetime. For every role, a missing cluster or client CA is now reported instatus.clientCertificate.messageand as a warning event. The docs also gain a short walkthrough for using the generated Secret withpsql.Closes #11312