Skip to content

Conversation

@LaurentGoderre
Copy link

@LaurentGoderre LaurentGoderre commented Dec 11, 2025

What this PR does / why we need it

When installing the kube-state-metrics with RBAC proxy enabled, the pod never reaches a healthy state.

> helm install rbac oci://ghcr.io/prometheus-community/charts/kube-state-metrics --set kubeRBACProxy.enabled=true
> kubectl describe pod/rbac-kube-state-metrics-668c776c-7r4vg

[...]
Events:
  Type     Reason     Age               From               Message
  ----     ------     ----              ----               -------
[...]
  Warning  Unhealthy  9s (x2 over 9s)   kubelet            Readiness probe errored and resulted in unknown state: strconv.Atoi: parsing "metrics": invalid syntax
  Warning  Unhealthy  3s (x2 over 13s)  kubelet            Liveness probe errored and resulted in unknown state: strconv.Atoi: parsing "http": invalid syntax

This is because the named ports are not created when rbac proxy is enabled. Additionally, having the host set to 127.0.0.1 when rbac proxy is enabled breaks the health check because the check originates from Kubernetes (outside the container) and therefore the connection is refused.

With this fix, the probes work as expected in all scenarios.

Special notes for your reviewer

Checklist

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

@LaurentGoderre LaurentGoderre force-pushed the kube-state-metrics-rbac-proxy-fix branch from 7c7cad4 to e6a0807 Compare December 11, 2025 14:31
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.

1 participant