[prometheus-node-exporter] make kube-rbac-proxy listen host configurable#6716
Open
firasmosbehi wants to merge 1 commit into
Open
Conversation
Signed-off-by: Firas Mosbehi <firas.mosbehi@insat.ucar.tn>
zeritti
requested changes
Mar 15, 2026
| port: 8100 | ||
| # Host prefix for kube-rbac-proxy secure listen address. | ||
| # Keep ":" to listen on all interfaces, or set values like "127.0.0.1:" or "$(POD_IP):". | ||
| listenHost: ":" |
Contributor
There was a problem hiding this comment.
If not set, the field's value is an empty string:
Suggested change
| listenHost: ":" | |
| listenHost: "" |
| {{- .Values.kubeRBACProxy.extraArgs | toYaml | nindent 12 }} | ||
| {{- end }} | ||
| - --secure-listen-address=:{{ .Values.service.port}} | ||
| - --secure-listen-address={{ .Values.kubeRBACProxy.listenHost }}{{ .Values.service.port}} |
Contributor
There was a problem hiding this comment.
Suggested change
| - --secure-listen-address={{ .Values.kubeRBACProxy.listenHost }}{{ .Values.service.port}} | |
| - --secure-listen-address={{ printf "%s:%d" .Values.kubeRBACProxy.listenHost (.Values.service.port | int) }} |
| # Specify the port used for the Node exporter container (upstream port) | ||
| port: 8100 | ||
| # Host prefix for kube-rbac-proxy secure listen address. | ||
| # Keep ":" to listen on all interfaces, or set values like "127.0.0.1:" or "$(POD_IP):". |
Contributor
There was a problem hiding this comment.
Suggested change
| # Keep ":" to listen on all interfaces, or set values like "127.0.0.1:" or "$(POD_IP):". | |
| # Keep default to listen on all interfaces, or set a custom value like "$(POD_IP)". |
The only reasonable setting for the IP to listen on is the pod's IP (POD_IP). Setting an environment variable in the container from a fieldRef is currently not supported by the chart, though.
| - exporter | ||
| type: application | ||
| version: 4.52.0 | ||
| version: 4.52.1 |
Contributor
There was a problem hiding this comment.
Suggested change
| version: 4.52.1 | |
| version: 4.53.0 |
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.
Summary
This PR makes kube-rbac-proxy listen host configurable in
prometheus-node-exporterand addresses #6250.Problem
When
kubeRBACProxy.enabled=true, the chart hardcodes--secure-listen-address=:<port>, which binds on all interfaces. Users with multi-NIC nodes cannot constrain exposure to a specific interface/IP without post-render patching.Root cause
The daemonset template hardcodes
--secure-listen-addresshost prefix and does not expose a corresponding value.Fix
kubeRBACProxy.listenHostin values with default":"to preserve existing behavior.--secure-listen-address={{ .Values.kubeRBACProxy.listenHost }}{{ .Values.service.port }}.4.52.0to4.52.1.Validation
helm lint charts/prometheus-node-exporterhelm template test charts/prometheus-node-exporter --set kubeRBACProxy.enabled=true --set service.port=9100 --set-string 'kubeRBACProxy.listenHost=$(POD_IP):'--secure-listen-address=$(POD_IP):9100.Compatibility
Default behavior remains unchanged because
listenHostdefaults to":"(all interfaces).