OCPBUGS-85777: Add root CA expiration monitoring for cert-manager - #882
OCPBUGS-85777: Add root CA expiration monitoring for cert-manager#882sebrandon1 wants to merge 2 commits into
Conversation
Adds PrometheusRule alerting on root CA certificate expiration via ACM Policy. Fires warning at 90 days and critical at 30 days before expiry. Extends existing CertificatePolicy to also monitor the cert-manager namespace. OCPBUGS-85777
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: sebrandon1 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds cert-manager root CA expiration alerting, local-cluster placement and binding resources, Kustomization entries, expanded certificate namespace coverage, and comparison metadata for the new resource set. ChangesCert-manager monitoring
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant ACM Policy
participant ConfigurationPolicy
participant PrometheusRule
ACM Policy->>ConfigurationPolicy: enforce root CA monitoring configuration
ConfigurationPolicy->>PrometheusRule: create expiration alert rules
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@telco-hub/configuration/reference-crs/optional/cert-manager/certManagerRootCAExpirationPolicy.yaml`:
- Around line 33-35: Update the PrometheusRule metadata in
certManagerRootCAExpirationPolicy so its namespace matches the queried
cert-manager namespace, or configure the required user-workload-monitoring
namespacesWithoutLabelEnforcement exemption for cert-manager-operator and keep
that exemption managed in configuration.
In
`@telco-hub/configuration/reference-crs/optional/cert-manager/kustomization.yaml`:
- Around line 16-18: Update the cert-manager optional Kustomization to include
the required metrics scrape ServiceMonitor and RBAC resources for the cluster
Prometheus User Workload stack, alongside the existing
certManagerRootCAExpirationPolicy resources. If these resources are
intentionally provisioned elsewhere, document that dependency and ensure the
external component reliably installs them.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 1061e58f-c7eb-4868-abe7-3bf27943e1bd
📒 Files selected for processing (11)
telco-hub/configuration/reference-crs-kube-compare/compare_ignoretelco-hub/configuration/reference-crs-kube-compare/default_value.yamltelco-hub/configuration/reference-crs-kube-compare/metadata.yamltelco-hub/configuration/reference-crs-kube-compare/optional/cert-manager/certManagerCertificatePolicy.yamltelco-hub/configuration/reference-crs-kube-compare/optional/cert-manager/certManagerRootCAExpirationPolicyPlacement.yamltelco-hub/configuration/reference-crs-kube-compare/optional/cert-manager/certManagerRootCAExpirationPolicyPlacementBinding.yamltelco-hub/configuration/reference-crs/optional/cert-manager/certManagerCertificatePolicy.yamltelco-hub/configuration/reference-crs/optional/cert-manager/certManagerRootCAExpirationPolicy.yamltelco-hub/configuration/reference-crs/optional/cert-manager/certManagerRootCAExpirationPolicyPlacement.yamltelco-hub/configuration/reference-crs/optional/cert-manager/certManagerRootCAExpirationPolicyPlacementBinding.yamltelco-hub/configuration/reference-crs/optional/cert-manager/kustomization.yaml
|
@sebrandon1: This pull request references Jira Issue OCPBUGS-85777, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
The metadata.yaml references this file for helm-convert parsing. Without it, the kube-compare check fails with "pattern matches no files".
Summary
Adds PrometheusRule alerting on root CA certificate expiration via ACM Policy. Fires warning at 90 days and critical at 30 days before expiry. Extends existing CertificatePolicy to also monitor the
cert-managernamespace.Split from #773 — this is the hub-side root CA monitoring only, independent of the hub-spoke trust and kubeconfig guidance work targeted for November.
OCPBUGS-85777
Changes
New resources (reference-crs + kube-compare templates):
certManagerRootCAExpirationPolicy.yaml— ACM Policy wrapping a PrometheusRule that monitorscertmanager_certificate_expiration_timestamp_secondscertManagerRootCAExpirationPolicyPlacement.yaml— targets local-clustercertManagerRootCAExpirationPolicyPlacementBinding.yaml— binds policy to placementModified:
certManagerCertificatePolicy.yaml— addscert-managerto monitored namespace listmetadata.yaml— addscert-manager-root-ca-monitoringcomponentcompare_ignore— adds ignore entries for RootCAExpirationPolicy and kustomizationdefault_value.yaml— addscert-managerto CertificatePolicy namespace defaultskustomization.yaml— adds three root CA monitoring resourcesTesting
Validated on OCP 4.21 hub with cert-manager v1.19.0 (see #773 for full test results).