[kube-state-metrics] add authFilter to enable native --auth-filter#7001
Open
yugstar wants to merge 1 commit into
Open
[kube-state-metrics] add authFilter to enable native --auth-filter#7001yugstar wants to merge 1 commit into
yugstar wants to merge 1 commit into
Conversation
Add an authFilter.enabled value that wires up kube-state-metrics native request authn/authz: it adds the --auth-filter flag and the create permissions on tokenreviews and subjectaccessreviews the filter requires. The RBAC rules reuse the existing block (previously gated only on kubeRBACProxy.enabled) by extending the gate, so they are not duplicated. Bump the chart to a new minor version and document the feature in the README alongside kube-rbac-proxy. Closes prometheus-community#6787 Signed-off-by: Aman Raj <aman.yug@gmail.com>
mrueg
approved these changes
Jun 18, 2026
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.
Adds an
authFilter.enabledvalue that makes kube-state-metrics' native request authn/authz (--auth-filter) easy to turn on, as an alternative tokube-rbac-proxy.Currently operators have to hand-wire this via
extraArgs: [--auth-filter]plusrbac.extraRulesfortokenreviews/subjectaccessreviews(as described in #6787). With this change,authFilter.enabled: true:--auth-filterflag to the kube-state-metrics container, andcreatepermissions ontokenreviewsandsubjectaccessreviewsthat the filter requires.The RBAC rules are not duplicated: the chart already renders them when
kubeRBACProxy.enabledis true, so I extended that gate toor kubeRBACProxy.enabled authFilter.enabled. Defaults are unchanged (feature is off by default;kube-rbac-proxybehavior is untouched). A README section documents it alongside kube-rbac-proxy, including a pointer to the upstream docs for the scraper-sideClusterRole/ClusterRoleBinding.Verified with
helm templateacross all gate combinations andhelm lint(0 failures).Closes #6787