How to use existing prometheus for Grafana on GKE?

11/4/2019

I have one question about Grafana. How I can use exiting Prometheus deamonset on GKE for Grafana. I do not want to spin up one more Prometheus deployment for just Grafana. I come up with this question after I spin up the GKE cluster. I have checked kube-system namespace and it turns out there is Prometheus deamonset already deployed.

$ kubectl get daemonsets -n kube-system
NAME                       DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR                                  AGE
prometheus-to-sd           2         2         2       2            2           beta.kubernetes.io/os=linux                    19d

and I would like to use this Prometheus

I have Grafana deployment with helm stable/grafana

$ kubectl get deploy -n dev
NAME                      READY   UP-TO-DATE   AVAILABLE   AGE
grafana                   1/1     1            1           9m20s

Currently, I am using stable/prometheus

-- Farkhod Sadykov
google-kubernetes-engine
grafana
kubernetes
kubernetes-helm
prometheus

1 Answer

11/4/2019

prometheus-to-sd is not a Prometheus instance, but a component that allows getting data from Prometheus to GCP's stackdriver. More info here: https://github.com/GoogleCloudPlatform/k8s-stackdriver/tree/master/prometheus-to-sd

If you'd like to have Prometheus you'll have to run it separately. (prometheus-operator helm chart is able to deploy whole monitoring stack to your GKE cluster easily (which my or may not be exactly what you need here).

Note that recent Grafana versions come with Stackdriver datasource, which allows you to query Stackdriver directly from Grafana (if all metrics you need are or can be in Stackdriver).

-- bjakubski
Source: StackOverflow