Skip to content

fix: add metrics auth RBAC to rbac_deployment component#79

Merged
scotwells merged 1 commit intomainfrom
fix/metrics-auth-rbac
Mar 19, 2026
Merged

fix: add metrics auth RBAC to rbac_deployment component#79
scotwells merged 1 commit intomainfrom
fix/metrics-auth-rbac

Conversation

@scotwells
Copy link
Contributor

@scotwells scotwells commented Mar 19, 2026

Summary

  • Add metrics_auth_role.yaml and metrics_auth_role_binding.yaml to the config/rbac_deployment/ kustomize Component
  • These grant the operator SA permission to create tokenreviews and subjectaccessreviews, which controller-runtime's metrics filter needs to validate bearer tokens from VMAgent

Context

The rbac_deployment component is used by the infra repo's Flux Kustomization to deploy RBAC alongside the operator. The existing config/rbac/ directory includes these files but is not used in the deployment path (config/manager + config/rbac_deployment).

Without this RBAC, the metrics filter returns 401 for all scrape requests because it cannot call the TokenReview API.

Test plan

  • Verify kustomize build succeeds with the component
  • After infra PR datum-cloud/infra#1995 is merged, verify workload-operator metrics show up in VMAgent targets

Add metrics_auth_role and metrics_auth_role_binding to the
rbac_deployment kustomize Component so the operator SA can perform
TokenReview and SubjectAccessReview for metrics authentication.

Without this RBAC, the controller-runtime metrics filter cannot
validate bearer tokens from VMAgent, causing all scrape requests
to fail with 401.
@scotwells scotwells merged commit 0a6eb1b into main Mar 19, 2026
9 checks passed
@scotwells scotwells deleted the fix/metrics-auth-rbac branch March 19, 2026 20:08
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.

2 participants