Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[kube-state-metrics] Use kube-rbac-proxy ports for probes when kube-rbac-proxy is enabled #5234

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

r0bj
Copy link
Contributor

@r0bj r0bj commented Jan 24, 2025

What this PR does / why we need it

When kubeRBACProxy is enabled, probes from the kubelet fail because the kube-state-metrics ports are bound to 127.0.0.1. This PR configures the probes to use the ports protected by kube-rbac-proxy, ensuring that health checks succeed when kube-rbac-proxy is enabled.

For more context, please refer to this comment.

Which issue this PR fixes

(optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged)

Special notes for your reviewer

Checklist

  • DCO signed
  • Chart Version bumped
  • Title of the PR starts with chart name (e.g. [prometheus-couchdb-exporter])

@r0bj r0bj changed the title [kube-state-metrics] Use kube-rbac-proxy ports for probes when kube-rbac-proxy Is enabled [kube-state-metrics] Use kube-rbac-proxy ports for probes when kube-rbac-proxy is enabled Jan 24, 2025
@fahedouch
Copy link

fahedouch commented Jan 24, 2025

thanks you for implementing this @r0bj. LGTM

For more context, please refer to #5215 (comment).

you comment link is pointing to the wrong comment ^^

Copy link
Member

@dotdc dotdc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @r0bj,
Thank you for your pull requests on this topic.
For the first part of the pull request, I think that you could use extraArgs and kubeRBACProxy.extraArgs directly.
If you need specific extra args for the http and telemetry containers, I would rather add something like kubeRBACProxy.extraHttpArgs and kubeRBACProxy.extraTelemetryArgs.
What do you think?

@r0bj
Copy link
Contributor Author

r0bj commented Jan 26, 2025

@dotdc Yes, that also makes sense. We can remove the conditional logic for including --ignore-paths in the kube-rbac-proxy containers and instead rely on .Values.kubeRBACProxy.extraArgs to pass --ignore-paths=/livez,/readyz. Would that approach work better?

@dotdc
Copy link
Member

dotdc commented Jan 26, 2025

Yes I would prefer, as it gives more flexibility.
Can you update the pull request?

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.

[kube-state-metrics] Readiness probe not working with rbac proxy
4 participants