From b9e041e09a57a784273136a1c35ae49e3efe3051 Mon Sep 17 00:00:00 2001 From: Edward Cheng Date: Wed, 26 Jun 2024 22:27:29 +1000 Subject: [PATCH] add grafana pod to prometheus service --- .../prometheus/app/deployment.yaml | 8 +++++++ .../prometheus/app/ingress.yaml | 22 ++++++++++++++++++- .../prometheus/app/service.yaml | 5 ++++- 3 files changed, 33 insertions(+), 2 deletions(-) diff --git a/kubernetes/infrastructure/prometheus/app/deployment.yaml b/kubernetes/infrastructure/prometheus/app/deployment.yaml index 8d018f9..f915fb6 100644 --- a/kubernetes/infrastructure/prometheus/app/deployment.yaml +++ b/kubernetes/infrastructure/prometheus/app/deployment.yaml @@ -41,6 +41,14 @@ spec: mountPath: /etc/prometheus/ - name: prometheus-storage-volume mountPath: /prometheus/ + - name: grafana + image: grafana/grafana + ports: + - containerPort: 3000 + volumeMounts: + - name: prometheus-storage-volume + mountPath: /var/lib/grafana + subPath: grafana volumes: - name: prometheus-config-volume hostPath: diff --git a/kubernetes/infrastructure/prometheus/app/ingress.yaml b/kubernetes/infrastructure/prometheus/app/ingress.yaml index 6c70019..fcbd49b 100644 --- a/kubernetes/infrastructure/prometheus/app/ingress.yaml +++ b/kubernetes/infrastructure/prometheus/app/ingress.yaml @@ -28,4 +28,24 @@ spec: service: name: prometheus port: - number: 9999 \ No newline at end of file + number: 9999 + - host: "grafana.cluster.edward.sydney" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: prometheus + port: + number: 3030 + - host: "grafana.cluster.local" + http: + paths: + - pathType: Prefix + path: "/" + backend: + service: + name: prometheus + port: + number: 3030 \ No newline at end of file diff --git a/kubernetes/infrastructure/prometheus/app/service.yaml b/kubernetes/infrastructure/prometheus/app/service.yaml index 03f68f5..f641c01 100644 --- a/kubernetes/infrastructure/prometheus/app/service.yaml +++ b/kubernetes/infrastructure/prometheus/app/service.yaml @@ -14,4 +14,7 @@ spec: - port: 9999 targetPort: 9090 protocol: TCP - name: http \ No newline at end of file + name: http + - name: grafana-port + port: 3030 + targetPort: 3000 \ No newline at end of file