Reputation: 163
I'm trying to integrate Grafana with managed prometheus service provided by Kubernetes Engine in GCP.
I configured Managed Prometheus service and I'm able see the metrics well, but I'm not able to integrate the managed prometheus service with Grafana on the same kubernetes cluster.
Below one is the managed prometheus metrics that are available.
I believe without endpoint URL, we cannot create Grafana dashboard. The issue is with creating the endpoint for managed prometheus on GKE.
I crawled all the web but couldn't find a way to create endpoint for managed prometheus for GKE. Can you please confirm me that is it actually possible to create an endpoint for Managed Prometheus for GKE cluster? if yes, can you please guide me how to grab that endpoint URL.
Thanks in advance.
Upvotes: 1
Views: 2376
Reputation: 12033
You need to deploy the frontend service. More details on using Grafana with Managed Prometheus can be found here, but here's the manifest:
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
spec:
replicas: 2
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
automountServiceAccountToken: true
nodeSelector:
kubernetes.io/os: linux
kubernetes.io/arch: amd64
containers:
- name: frontend
image: "gke.gcr.io/prometheus-engine/frontend:v0.5.0-gke.0"
args:
- "--web.listen-address=:9090"
- "--query.project-id=$PROJECT_ID"
ports:
- name: web
containerPort: 9090
readinessProbe:
httpGet:
path: /-/ready
port: web
livenessProbe:
httpGet:
path: /-/healthy
port: web
---
apiVersion: v1
kind: Service
metadata:
name: frontend
spec:
clusterIP: None
selector:
app: frontend
ports:
- name: web
port: 9090
Upvotes: 3