Skip to content

Commit 65caf6a

Browse files
committed
Allow defaulting to release namespace for ServiceMonitor
1 parent ba2bd65 commit 65caf6a

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

charts/memgraph-high-availability/templates/mg-exporter.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ apiVersion: monitoring.coreos.com/v1
8080
kind: ServiceMonitor
8181
metadata:
8282
name: mg-exporter
83-
namespace: {{ $.Values.prometheus.namespace }}
83+
namespace: {{ $.Values.prometheus.namespace | default $.Release.Namespace }}
8484
labels:
8585
release: {{ $.Values.prometheus.serviceMonitor.kubePrometheusStackReleaseName }}
8686
spec:
@@ -92,6 +92,6 @@ spec:
9292
interval: {{ $.Values.prometheus.serviceMonitor.interval }}
9393
namespaceSelector:
9494
matchNames:
95-
- {{ $.Values.prometheus.namespace }} # This refers to where our service exposing the exporter is located
95+
- {{ $.Values.prometheus.namespace | default $.Release.Namespace }} # This refers to where our service exposing the exporter is located
9696
{{- end }}
9797
{{- end }}

charts/memgraph/templates/mg-exporter.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ apiVersion: monitoring.coreos.com/v1
7171
kind: ServiceMonitor
7272
metadata:
7373
name: mg-exporter
74-
namespace: {{ .Values.prometheus.namespace }}
74+
namespace: {{ .Values.prometheus.namespace | default .Release.Namespace }}
7575
labels:
7676
release: {{ .Values.prometheus.serviceMonitor.kubePrometheusStackReleaseName }}
7777
spec:
@@ -83,6 +83,6 @@ spec:
8383
interval: {{ .Values.prometheus.serviceMonitor.interval }}
8484
namespaceSelector:
8585
matchNames:
86-
- {{ .Values.prometheus.namespace }} # This refers to where our service exposing the exporter is located
86+
- {{ .Values.prometheus.namespace | default .Release.Namespace }} # This refers to where our service exposing the exporter is located
8787
{{- end }}
8888
{{- end }}

0 commit comments

Comments
 (0)