Skip to content
This repository was archived by the owner on Mar 20, 2026. It is now read-only.

Control the start of event reporting for expiring certificates - #2232

Merged
allanrogerr merged 3 commits into
minio:masterfrom
allanrogerr:add-certificate-rotate-threshold
Jul 23, 2024
Merged

allanrogerr merged 3 commits into
minio:masterfrom
allanrogerr:add-certificate-rotate-threshold

Conversation

@allanrogerr

@allanrogerr allanrogerr commented Jul 22, 2024 •

Copy link
Copy Markdown
Contributor

Issue summary

In cases where users install certificates of short duration, kubernetes events are spammed with multiple warnings of certificate expiry. This is undesirable. A means on reducing the number of warnings produced is more desirable.
See #1791

In the tenant crd, .spec.certExpiryAlertThreshold represents the minimum number of days to expiry before an alert for an expiring certificate is fired.
For example considering .spec.certExpiryAlertThreshold = 1, if a given certificate will expire in 7 days then expiration events will only be triggered 1 day before expiry.

Test summary

  1. Build and install the minio operator
  2. Apply a tenant with Helm or Kustomize
  3. Create expired and expiring certificates
  4. Create secrets based on these
  5. Apply the secrets as external certificates
  6. Experiment with different values of certExpiryAlertThreshold e.g.
  7. Observe
  • if certExpiryAlertThreshold is not present then all certificate expiry events are reported. This is current functionality
  • if the whole number of days left for a certificate to expire is less than certExpiryAlertThreshold then the certificate expiry events are reported
  • if the whole number of days left for a certificate to expire is greater than or equal to certExpiryAlertThreshold then the certificate expiry events are not reported
  • expired certificate events are always reported

Verbose tests here:
https://github.com/allanrogerr/public/wiki/operator%E2%80%901791

Fixes: #1791

@allanrogerr allanrogerr self-assigned this Jul 22, 2024
@allanrogerr
allanrogerr marked this pull request as ready for review July 22, 2024 16:58
pjuarezd
pjuarezd previously approved these changes Jul 22, 2024
Comment thread pkg/controller/custom.go Resolved

@shtripat shtripat left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, verified

@ramondeklein ramondeklein left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to see the expiration check to be moved out of the outer if to ensure we're always reporting that. We have already spent a lot of Subnet hours, because of unnoticed certificate expirations.

Comment thread pkg/controller/custom.go Resolved
@allanrogerr
allanrogerr merged commit 2c72c36 into minio:master Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support disabling certificate checks for frequently rotated certificates

5 participants