Aller au contenu

KubeStateMetricsListError#

This alert triggered when Kube-State-Metrics fails to list resources.

Troubleshooting Hints#

kubectl get pods -n  <monitoring_namespace> | grep kube-state-metrics  # check pod is up and running
kubectl logs <kube-state-metrics> -n <monitoring_namespace>

Tip

Where <monitoring_namespace> can be:

  • Zone Infra/Cloud : monitoring
  • Zone Client : caascad-monitoring
  • monitoring

We can identify in the logs which resource is involved, so we can do:

kubectl get 'resource'

Known cases#

Here an example related to pods (resources) listing access. So it can happen for any other resource.

failed to list *v1.Pod: pods is forbidden: User "system:serviceaccount:monitoring:caascad-kube-state-metrics" cannot list resource "pods" in API group "" at the cluster scope

We clearly can see that the user "system:serviceaccount:monitoring:caascad-kube-state-metrics" has not the right to list pods.

So we can check the kube-state-metrics clusterrole pods authorizations.