added metrics auth rbac#198
Open
Bloodraven21 wants to merge 3 commits into
Open
Conversation
Signed-off-by: Ishan Jain <ishanij10115@gmail.com>
| @@ -0,0 +1,65 @@ | |||
| {{- if .Values.rbac.create -}} | |||
Contributor
There was a problem hiding this comment.
This RBAC renders independent of metrics.enabled/metrics.secure. Setting metrics.enabled: false still creates these ClusterRoles/Bindings, leaving orphaned cluster-scoped RBAC. Consider gating on metrics.secure as controller-runtime only makes tokenreview and subjectaccessreview API calls when it's doing delegated authn/authz on an incoming scrape and not on insecure metrics.
Consider below suggestions:
Suggested change
| {{- if .Values.rbac.create -}} | |
| {{- if and .Values.rbac.create .Values.metrics.enabled -}} |
or
Suggested change
| {{- if .Values.rbac.create -}} | |
| {{- if and .Values.rbac.create .Values.metrics.enabled .Values.metrics.secure -}} |
Collaborator
Author
There was a problem hiding this comment.
thanks will check this
|
|
||
| ## Unreleased | ||
| ### Added | ||
| -Add metrics auth RBAC (metrics-auth-role, metrics-reader-role) support to the valkey-operator chart |
Contributor
There was a problem hiding this comment.
nit: you may want to add space after -
Signed-off-by: Ishan Jain <ishanij10115@gmail.com>
Signed-off-by: Ishan Jain <ishanij10115@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#192
Operator: secure metrics with auth RBAC (metrics-auth + metrics-reader)
Closes #192
Summary
The operator served its controller-runtime metrics over plain HTTP because the deployment hardcoded --metrics-secure=false, and the chart shipped none of the RBAC the kubebuilder secure-metrics convention requires. This PR adds that RBAC, makes secure
mode toggleable, and documents and tests the flow.
Changes
scrape requests.
Disabled by default, so the admin binds the scraper manually unless they opt in.
Backward compatibility
metrics.secure defaults to false and metrics.reader.binding.create defaults to false, so existing installs are unchanged.
Testing
the optional reader binding including its tpl behavior.
Values
metrics:
secure: false
reader:
binding:
create: false
serviceAccountName: ""
namespace: ""