Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Control the start of event reporting for expiring certificates #2232

Merged

Conversation

allanrogerr
Copy link
Contributor

@allanrogerr allanrogerr commented Jul 22, 2024

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
helm/operator/templates/minio.min.io_tenants.yaml Outdated Show resolved Hide resolved
pkg/controller/custom.go Show resolved Hide resolved
resources/base/crds/minio.min.io_tenants.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@shtripat shtripat left a comment

Choose a reason for hiding this comment

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

lgtm, verified

Copy link
Contributor

@ramondeklein ramondeklein left a comment

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.

pkg/controller/custom.go Show resolved Hide resolved
@allanrogerr allanrogerr merged commit 2c72c36 into minio:master Jul 23, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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