Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to scrape other namespaces when using kube-prometheus

Prometheus deployed using kube-prometheus can't scrape 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.

like image 264
Rafael Soares - tuelho Avatar asked Oct 26 '25 15:10

Rafael Soares - tuelho


1 Answers

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.

like image 132
Rick Rackow Avatar answered Oct 28 '25 06:10

Rick Rackow