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 upKubernetes and prometheus in different host #2430
Comments
This comment has been minimized.
This comment has been minimized.
andrewhowdencom
commented
Feb 15, 2017
|
You might be able to point them at the same API endpoint as the endpoint This might be a good candidate for federation. https://prometheus.io/docs/operating/federation/ Suggest moving this question to StackOverflow, as it's not strictly code related, but rather docs related. |
This comment has been minimized.
This comment has been minimized.
|
See the |
This comment has been minimized.
This comment has been minimized.
|
Thanks @brancz All are OK but facings problem on "kubernetes-service-endpoints", saying its down and looks like its taking internal kubernetes IP. My prometheus config file as follows ...
-- |
This comment has been minimized.
This comment has been minimized.
|
Your Prometheus instance needs access to the private network your Kubernetes cluster is using, for example if you are using flannel, then you need to add the machine Prometheus is running on to that flannel network. Once you can ping those private IPs from that machine this discovery should also work. |
This comment has been minimized.
This comment has been minimized.
|
That mean one pod/container (Prometheus) need to run inside kuberetes cluster ? |
This comment has been minimized.
This comment has been minimized.
|
That would be a possibility having Prometheus running inside the cluster is certainly the most common practice when you monitor Kubernetes and things running on top of Kubernetes, but it would also work if your machine outside of the Kubernetes cluster is just part of the network to be able to route those IPs. |
This comment has been minimized.
This comment has been minimized.
|
why keeping outside bcoz we are not monitoring only kubernetes also other things also monitoring. if I run any kubernetes pod/container in side cluster what will be config file inside prometheus, only Any configuration need to change in external prometheus ? or any alternate approch ? |
This comment has been minimized.
This comment has been minimized.
|
You can still monitor things outside of Kubernetes when using a Prometheus that is running inside of Kubernetes. Otherwise there is nothing wrong with running two instances of Prometheus, one for monitoring targets inside of Kubernetes and one for monitoring targets outside of Prometheus.
I don't understand this, could you please rephrase it? |
This comment has been minimized.
This comment has been minimized.
|
There was a problem in kubedns thats why endpoint fails.
After dns issue resolved all ok
Thanks & regards,
Prasenjit
On 3 Mar 2017, at 7:12 p.m., Frederic Branczyk <notifications@github.com<mailto:notifications@github.com>> wrote:
You can still monitor things outside of Kubernetes when using a Prometheus that is running inside of Kubernetes. Otherwise there is nothing wrong with running two instances of Prometheus, one for monitoring targets inside of Kubernetes and one for monitoring targets outside of Prometheus.
if I run any kubernetes pod/container in side cluster what will be config file inside prometheus, only
target: localhost:9090 will work ?
I don't understand this, could you please rephrase it?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2430 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ASbWgfReJm2KFi_QUpgHbctMREqKRb-Zks5riBjMgaJpZM4MBrA9>.
|
This comment has been minimized.
This comment has been minimized.
|
Great! Can we close this issue here then? |
This comment has been minimized.
This comment has been minimized.
|
Yes please.
Thanks & regards,
Prasenjit
On 7 Mar 2017, at 1:56 p.m., Frederic Branczyk <notifications@github.com<mailto:notifications@github.com>> wrote:
Great! Can we close this issue here then?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#2430 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/ASbWgW3McXHNL-wBFxZMgN_0Y9nBUinLks5rjRS_gaJpZM4MBrA9>.
|
beorn7
closed this
Mar 7, 2017
This comment has been minimized.
This comment has been minimized.
hiscal2015
commented
Apr 1, 2017
|
@prasenforu I also need to run Prometheus outside of Kubernetes cluster, but how to deal with the token? I see you only defined api server address in the config file. |
This comment has been minimized.
This comment has been minimized.
|
Suggest allways use inside kubernetes. |
This comment has been minimized.
This comment has been minimized.
greenled
commented
Nov 23, 2017
|
Also having troubles with token. @prasenforu did you find anything about it? |
This comment has been minimized.
This comment has been minimized.
costimuraru
commented
Jun 25, 2018
|
We also have the Prometheus server outside of k8s. Any idea how to deal with the token and make it work? |
This comment has been minimized.
This comment has been minimized.
lnformer
commented
Aug 19, 2018
•
|
i think the documentation is laking of how to properly monitor externally kubernetes with prometheus. |
This comment has been minimized.
This comment has been minimized.
damien-roche
commented
Aug 25, 2018
•
|
Utterly confused this hasn't been addressed yet. Everybody is monitoring Kube from inside Kube? I have multiple Kube clusters and I have random nodes dotted around (apps, postgres, rabbitmq, etc). I have a central Prometheus server which pulls in metrics from my nodes no problem. I don't want another Prometheus instance chewing up ram on every Kube cluster; I already have an instance. "Otherwise there is nothing wrong with running two instances of Prometheus, one for monitoring targets inside of Kubernetes and one for monitoring targets outside of Prometheus." So if we have multiple Kube clusters we will have a Prometheus instance for each cluster? What if you have 5 clusters? Now I have to manage 5 different Prometheus instances each related to a different cluster? I just want centralised monitoring. Can somebody in the know please document this. I don't understand how it isn't a common use-case. EDIT. I have turned up some possible solutions. An answer on SO suggests a federation setup. Prometheus inside your cluster, expose metrics from that to outside the cluster and your central/external Prometheus instance(s). (https://stackoverflow.com/a/47643005/419017) There is also a project here which exposes cluster level metrics: https://github.com/kubernetes/kube-state-metrics Hope that gives someone else something to run with. |
This comment has been minimized.
This comment has been minimized.
|
But anyway we have to run Prometheus in each cluster. That I do not want . Basically I want to run Prometheus completely out of kubernetes cluster. |

prasenforu commentedFeb 15, 2017
My prometheus server running on different host.
I was using the Link here as guide to config..
https://github.com/prometheus/prometheus/blob/master/documentation/examples/prometheus-kubernetes.yml
Not sure where I can give my kubernetes API servers endpoints.
in above example.