Unable to scrap other namespaces when using kube-prometheus

6/3/2019

Prometheus deployed using kube-prometheus can't scrap resources on namespaces other than default, monitoring and kube-system. I added additional namespaces on my jsonnet as described in kube-prometheus README but no success...

I also tried to create a new ServiceMonitor manually, but no success...

I appreciate any help. Thanks.

-- Rafael Soares - tuelho
kubernetes
prometheus-operator

1 Answer

7/11/2019

If you used the pre-compiled manifests here you will only have your service account with 3 rolebindings allowing access to the namespaces you mentioned.

You can add more namespaces for example by applying the same roleBinding in more namespaces.

This is more secure as opposed to using a clusterRoleBinding since it allows for more finegrained permissions.

-- Rick Rackow
Source: StackOverflow