Able to solve the issue. There is a configuration error in one config file where namespaces were not added. Also if we add node role, then clusterrole, clusterolebinding is needed, as node resource is cluster scoped.
Thanks n Regards, Chalapathi On Tue, May 26, 2020 at 10:31 PM Venkata Bhagavatula < [email protected]> wrote: > Hi All, > > Currently Prometheus needs ClusterRole and ClusterRoleBinding for > scrapping the metrics on Kubernetes. We want to restrict the prometheus to > a particular namespace. > So we changed RBAC to using Role and RoleBinding and in the > Prometheus configuration we added namespaces to kubernetes_sd_configs > section. we see that we are able to scrape metrics > from the configured namespace, but continuously seeing the errors saying > access forbidden to *v1.Pod etc. Currently my cluster is down. will share > the exact error once it is available. > > Following is the Prometheus configuration: > - job_name: 'kubernetes-apiservers' > > kubernetes_sd_configs: > - role: endpoints > namespaces: > names: ['admin'] > > Please let me know whether we can do with Role and RoleBinding? > > Thanks n Regards, > Chalapathi. > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CABXnQPtWZNzbN-1OMpMQSBMFJNYrpMFsG7hp7zHS_W%2BZyvXTsg%40mail.gmail.com.

