Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upPrometheus not discovering from kubernetes #2763
Comments
This comment has been minimized.
This comment has been minimized.
|
Were you able to successfully create the ClusterRole and ClusterRoleBinding from the rbac.yaml? This sounds like a problem with RBAC. |
This comment has been minimized.
This comment has been minimized.
|
Expected.. I took it from https://github.com/prometheus/prometheus/blob/master/documentation/examples/rbac-setup.yml Output as follows.. kubectl get ClusterRole prometheus -o yaml
kubectl get ClusterRoleBinding prometheus -o yaml
|
This comment has been minimized.
This comment has been minimized.
|
So when you list |
This comment has been minimized.
This comment has been minimized.
|
I am a cluster admin, not sure what you trying to find out. |
This comment has been minimized.
This comment has been minimized.
|
You being cluster admin doesn't matter. What matters is which service account Prometheus is running with, as it needs permissions to access the k8s API. Your error logs from the initial post indiciate that it's running on the |
This comment has been minimized.
This comment has been minimized.
|
I think SA I use prometheus and NS I use default apiVersion: v1 As I told earlier I took it from https://github.com/prometheus/prometheus/blob/master/documentation/examples/rbac-setup.yml Nothing edited. But in logs I can see "system:serviceaccount:default:default" |
This comment has been minimized.
This comment has been minimized.
|
Yes you need to specify in your deployment which |
This comment has been minimized.
This comment has been minimized.
|
Ya now I got it :) Thanks all |
fabxc
closed this
May 24, 2017
This comment has been minimized.
This comment has been minimized.
marccarre
commented
Jul 5, 2017
|
To be explicit, and in case someone else faces the same difficulties and stumbles on this GitHub issue:
|
simon-mo
added a commit
to simon-mo/clipper
that referenced
this issue
May 4, 2018
doi-t
added a commit
to doi-t/ex-gcp-k8s-prometheus
that referenced
this issue
Jul 14, 2018
This comment has been minimized.
This comment has been minimized.
alexellis
commented
Jan 27, 2019
|
Hey @brancz I wondered if you knew if we could add only a Role rather than ClusterRole to Prometheus for scraping from multiple replicas of a Deployment within a set namespace? Right now scraping with DNS SD doesn't give the expected result on Kubernetes, so it's lead us to look at the pod-level discovery. |
This comment has been minimized.
This comment has been minimized.
|
@alexellis by default the Kubernetes SD performs list/watch for all namespaces, therefore a ClusterRole is required. However, you can specify the specific namespaces you want to monitor as well, then you can just use a Role for that specific namespace. See the |
prasenforu commentedMay 24, 2017
Running kubernetes 1.6.2 using kubeadm
Getting following error
prometheus-rbac.yml file content
Configmap file content -