Skip to content

fix: remove dead metrics RBAC, document NetworkPolicy prereq, add scrape-down alert#23

Merged
bdchatham merged 1 commit intomainfrom
fix/observability-followups
Mar 24, 2026
Merged

fix: remove dead metrics RBAC, document NetworkPolicy prereq, add scrape-down alert#23
bdchatham merged 1 commit intomainfrom
fix/observability-followups

Conversation

@bdchatham
Copy link
Collaborator

@bdchatham bdchatham commented Mar 24, 2026

Summary

Follow-up to #22 addressing non-blocking observations from the expert review:

  • Remove dead RBAC resources: metrics_auth_role, metrics_auth_role_binding, and metrics_reader_role were scaffolded by kubebuilder for the old HTTPS metrics endpoint (--metrics-secure=true). With metrics now served over plain HTTP, these ClusterRoles/Bindings (TokenReview, SubjectAccessReview permissions) are unused and should be cleaned up.
  • Document NetworkPolicy prerequisite: The allow-metrics-traffic NetworkPolicy requires the Prometheus namespace to have metrics=enabled label. Added a comment directly in the manifest so operators know to run kubectl label namespace <prometheus-ns> metrics=enabled.
  • Add ControllerMetricsDown meta-alert: Fires when Prometheus can't scrape the controller for 5 minutes (up{job=~".*sei-k8s-controller.*"} == 0). This is the "alert on alerts being blind" pattern -- without it, a broken scrape config or NetworkPolicy issue would silently disable all other controller alerts.

Test plan

  • Verify make manifests still succeeds (no RBAC drift)
  • Confirm the 3 deleted RBAC resources are pruned from the cluster after Flux reconcile
  • Verify ControllerMetricsDown appears in Prometheus alerts UI

Made with Cursor

…ape-down alert

Follow-up from expert review non-blocking observations:

- Remove metrics_auth_role, metrics_auth_role_binding, and
  metrics_reader_role -- these protected the old HTTPS metrics
  endpoint which was replaced by plain HTTP in the observability PR
- Document the `metrics=enabled` namespace label prerequisite on the
  NetworkPolicy so operators know why Prometheus scrapes are blocked
- Add ControllerMetricsDown alert that fires when Prometheus cannot
  scrape the controller for 5 minutes, ensuring other alerts aren't
  silently blind

Made-with: Cursor
@bdchatham bdchatham force-pushed the fix/observability-followups branch from 37e9de9 to c43c99c Compare March 24, 2026 03:44
@bdchatham bdchatham merged commit 498136b into main Mar 24, 2026
2 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.

1 participant