From 3bd30804018c25a5f576d45afd7a6f6aac82dba9 Mon Sep 17 00:00:00 2001 From: roy_fuel <96140895+rfuelsh@users.noreply.github.com> Date: Mon, 16 Sep 2024 22:17:22 -0400 Subject: [PATCH] feat: Adding service monitor to helm chart (#541) --- helm/fuel-explorer/Chart.yaml | 2 +- helm/fuel-explorer/templates/servicemonitor.yaml | 15 +++++++++++++++ helm/fuel-explorer/values.yaml | 5 +++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 helm/fuel-explorer/templates/servicemonitor.yaml diff --git a/helm/fuel-explorer/Chart.yaml b/helm/fuel-explorer/Chart.yaml index 562f4ac43..0187195f4 100644 --- a/helm/fuel-explorer/Chart.yaml +++ b/helm/fuel-explorer/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.11 +version: 0.1.12 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/helm/fuel-explorer/templates/servicemonitor.yaml b/helm/fuel-explorer/templates/servicemonitor.yaml new file mode 100644 index 000000000..62f88095a --- /dev/null +++ b/helm/fuel-explorer/templates/servicemonitor.yaml @@ -0,0 +1,15 @@ +{{- if .Values.app.serviceMonitor.enabled }} +apiVersion: monitoring.coreos.com/v1 +kind: ServiceMonitor +metadata: + name: {{ include "fuel-explorer.fullname" . }} + labels: + release: {{ .Values.app.serviceMonitor.prometheusRelease }} +spec: + selector: + matchLabels: + {{- include "fuel-explorer.labels" . | nindent 4 }} + endpoints: + - path: /metrics + port: http +{{- end }} diff --git a/helm/fuel-explorer/values.yaml b/helm/fuel-explorer/values.yaml index 82263c908..783c0a3e8 100644 --- a/helm/fuel-explorer/values.yaml +++ b/helm/fuel-explorer/values.yaml @@ -83,3 +83,8 @@ nodeSelector: {} tolerations: [] affinity: {} + +app: + serviceMonitor: + enabled: true + prometheusRelease: kube-prometheus