When using limited privilege environment (roles) empty metrics endpoint #2400
Labels
kind/bug
Categorizes issue or PR as related to a bug.
triage/accepted
Indicates an issue or PR is ready to be actively worked on.
What happened:
I ran kube-state-metrics using Roles and RoleBindings following: https://github.com/kubernetes/kube-state-metrics?tab=readme-ov-file#limited-privileges-environment but I did not pass in
--namespaces
as it should default to all namespaces including the current one. When I navigate tolocalhost:8080/metrics
the endpoint is blank.What you expected to happen:
When using limited privileges (roles and not clusterroles) it should have metrics on the current namespace. Note this works if you do pass in
--namespaces
but it should work regardless as the default value monitors all namespaces based on: https://github.com/kubernetes/kube-state-metrics/blob/main/pkg/options/options.go#L146How to reproduce it (as minimally and precisely as possible):
--namespaces
as it should default to all namespaces by defaultlocalhost:8080/metrics
and you should see no metricsAnything else we need to know?:
I'm working on deploying kube-state-metrics in a tenanted environment that is using: https://github.com/kubernetes-sigs/hierarchical-namespaces.
Environment:
kubectl version
): v1.27.12-gke.1115000The text was updated successfully, but these errors were encountered: