Skip to content

feat: add metrics auth RBAC, metrics-reader, and ServiceMonitor#168

Open
daanvinken wants to merge 1 commit into
valkey-io:mainfrom
daanvinken:feat/operator-helm-metrics-rbac
Open

feat: add metrics auth RBAC, metrics-reader, and ServiceMonitor#168
daanvinken wants to merge 1 commit into
valkey-io:mainfrom
daanvinken:feat/operator-helm-metrics-rbac

Conversation

@daanvinken

Copy link
Copy Markdown
Contributor

Description

Follow-up to #162. Adds the bits needed for secure metrics and Prometheus scraping.

New metrics.secure toggle (defaults to false). When flipped to true it creates the tokenreviews/subjectaccessreviews RBAC the operator needs for --metrics-secure=true, and switches the service port name to https. Also adds a metrics-reader ClusterRole for /metrics access.

ServiceMonitor template behind prometheus.serviceMonitor.enabled, picks up the right scheme/port based on the secure flag.

Cleaned up the TODOs in values.yaml that this covers.

Testing

Linted, templated, deployed on kind with both secure on and off. RBAC resources show up when expected, operator args are correct.


- Add metrics-auth ClusterRole/ClusterRoleBinding (tokenreviews,
  subjectaccessreviews) gated on metrics.secure
- Add metrics-reader ClusterRole for /metrics endpoint access
- Add Prometheus ServiceMonitor template gated on
  prometheus.serviceMonitor.enabled
- Add metrics.secure toggle to switch between HTTP and HTTPS metrics
- Toggle service port name and ServiceMonitor scheme based on
  metrics.secure
- Remove resolved TODOs from values.yaml

Signed-off-by: Daan Vinken <daanvinken@tythus.com>
@bjosv

bjosv commented May 11, 2026

Copy link
Copy Markdown
Collaborator

It seems that we also need to update the crd's from valkey-operator:v0.1.0, maybe can be included in this PR?

@bjosv

bjosv commented May 13, 2026

Copy link
Copy Markdown
Collaborator

I added a #174 since the update can be done separately.

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