Skip to content

alert-mgmt-03: relabel config, alerting health & AlertingRule CRD#2

Open
sradco wants to merge 1 commit intoalert-mgmt-02-k8s-alert-queriesfrom
alert-mgmt-03-k8s-relabel-health
Open

alert-mgmt-03: relabel config, alerting health & AlertingRule CRD#2
sradco wants to merge 1 commit intoalert-mgmt-02-k8s-alert-queriesfrom
alert-mgmt-03-k8s-relabel-health

Conversation

@sradco
Copy link
Owner

@sradco sradco commented Feb 25, 2026

Alert Management API — Part 3/14: relabel config, alerting health & AlertingRule CRD

Summary

  • AlertRelabelConfig CRD manager: informer-backed CRUD for AlertRelabelConfig resources (namespace-scoped)
  • AlertingRule CRD manager: informer-backed CRUD for AlertingRule resources (cluster-monitoring namespace)
  • Relabeled rules engine (relabeledRulesManager): watches PrometheusRules and ARC secrets, applies Prometheus relabel configs, and caches the resulting rule set with work-queue-based reconciliation
  • AlertingHealth endpoint implementation: ConfigMap watcher for cluster-monitoring-config (user-workload-enabled detection), combined with route-probing health from PR 2
  • External management detection: ArgoCD/GitOps annotation/label checking for PrometheusRules
  • Alert rule ID generation and management label constants (openshift_io_rule_managed_by, ARC label/annotation keys)
  • New k8s Client interface extensions: AlertingHealth(), AlertRelabelConfigs(), AlertingRules(), RelabeledRules()

Dependencies

This PR is part of a stacked series. Please review in order.

  1. alert-mgmt-01: k8s foundation + health stub skeleton
  2. Pending — alert listing, query & filter primitives
  3. → This PR — relabel config, alerting health & AlertingRule CRD
    4–14. Pending — management foundation, CRUD endpoints, classification, bulk update, docs/CI/e2e, single-rule API

@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from af91c3f to c4c75e8 Compare February 25, 2026 22:35
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from 92450d6 to 8e35f9b Compare February 25, 2026 22:35
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from c4c75e8 to a980ad1 Compare February 25, 2026 22:52
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from 8e35f9b to 491b730 Compare February 25, 2026 22:52
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from a980ad1 to a8171e2 Compare February 25, 2026 23:57
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from 491b730 to 65ec1fa Compare February 25, 2026 23:57
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from a8171e2 to 648db25 Compare February 26, 2026 14:41
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from 65ec1fa to 47f642b Compare February 26, 2026 14:41
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from 648db25 to 8828c5a Compare February 26, 2026 14:46
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch 2 times, most recently from 30f53a3 to 7947697 Compare February 27, 2026 11:44
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from 8828c5a to 446a95a Compare February 27, 2026 11:57
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from 7947697 to 8975350 Compare February 27, 2026 11:57
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from 446a95a to 12c4d9f Compare February 27, 2026 11:59
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from 8975350 to 7b95da5 Compare February 27, 2026 11:59
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from 12c4d9f to d8acbb4 Compare February 27, 2026 12:09
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from 7b95da5 to 36a17c2 Compare February 27, 2026 12:09
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from d8acbb4 to 314d236 Compare February 27, 2026 13:12
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch 2 times, most recently from 17a0553 to f23cef8 Compare March 2, 2026 09:26
…gRule CRD support

Add remaining k8s layer capabilities:
- AlertRelabelConfig CRUD operations for OpenShift AlertRelabelConfig CRs
- RelabeledRules: applies Prometheus relabel configs to derive effective
  alert rules with source/management labels
- AlertingHealth: route reachability checks for platform and user-workload
  Prometheus/Alertmanager endpoints
- AlertingRule CRUD operations for OpenShift AlertingRule CRs
- ExternalManagement label helpers

Also adds supporting leaf packages:
- pkg/managementlabels: management label constants and helpers
- pkg/alert_rule: alert rule ID generation and parsing

Signed-off-by: Shirly Radco <sradco@redhat.com>
Signed-off-by: João Vilaça <jvilaca@redhat.com>
Signed-off-by: Aviv Litman <alitman@redhat.com>
Co-authored-by: AI Assistant <noreply@cursor.com>
@sradco sradco force-pushed the alert-mgmt-02-k8s-alert-queries branch from 314d236 to d853dd3 Compare March 2, 2026 10:04
@sradco sradco force-pushed the alert-mgmt-03-k8s-relabel-health branch from f23cef8 to ba845e4 Compare March 2, 2026 10:04
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.

1 participant