From 9e300baf89c7ee5d828202841088f80a9c1c13f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan-Otto=20Kr=C3=B6pke?= Date: Tue, 1 Nov 2022 11:58:59 +0100 Subject: [PATCH] [Helm] Add toggle for MetricsInstance (#7525) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jan-Otto Kröpke **What this PR does / why we need it**: Chart version 3.3.0 introduced a new MetricsInstance CR. The only way to disable the MetricsInstance is `--set loki.monitoring.serviceMonitor.metricsInstance=null`, but this raises helm warning... ``` coalesce.go:220: warning: cannot overwrite table with non table for loki.monitoring.serviceMonitor.metricsInstance (map[annotations:map[] labels:map[] remoteWrite:]) coalesce.go:220: warning: cannot overwrite table with non table for loki.monitoring.serviceMonitor.metricsInstance (map[annotations:map[] labels:map[] remoteWrite:]) coalesce.go:220: warning: cannot overwrite table with non table for loki.monitoring.serviceMonitor.metricsInstance (map[annotations:map[] labels:map[] remoteWrite:]) ``` **Checklist** - [ ] Reviewed the `CONTRIBUTING.md` guide - [ ] Documentation added - [ ] Tests updated - [ ] `CHANGELOG.md` updated - [ ] Changes that require user attention or interaction to upgrade are documented in `docs/sources/upgrading/_index.md` Signed-off-by: Jan-Otto Kröpke --- docs/sources/installation/helm/reference.md | 10 ++++++++++ .../loki/templates/monitoring/metrics-instance.yaml | 2 +- production/helm/loki/values.yaml | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/sources/installation/helm/reference.md b/docs/sources/installation/helm/reference.md index 582cc3110d..98b6ee60f1 100644 --- a/docs/sources/installation/helm/reference.md +++ b/docs/sources/installation/helm/reference.md @@ -1968,6 +1968,7 @@ null
 {
   "annotations": {},
+  "enabled": true,
   "labels": {},
   "remoteWrite": null
 }
@@ -1981,6 +1982,15 @@ null
 			
 {}
 
+ + + + monitoring.serviceMonitor.metricsInstance.enabled + bool + If enabled, MetricsInstance resources for Grafana Agent Operator are created +
+true
+
diff --git a/production/helm/loki/templates/monitoring/metrics-instance.yaml b/production/helm/loki/templates/monitoring/metrics-instance.yaml index b7205dcb22..014b21a4c6 100644 --- a/production/helm/loki/templates/monitoring/metrics-instance.yaml +++ b/production/helm/loki/templates/monitoring/metrics-instance.yaml @@ -1,4 +1,4 @@ -{{- if .Values.monitoring.serviceMonitor.enabled }} +{{- if and .Values.monitoring.serviceMonitor.enabled .Values.monitoring.serviceMonitor.metricsInstance.enabled }} {{- with .Values.monitoring.serviceMonitor.metricsInstance }} apiVersion: monitoring.grafana.com/v1alpha1 kind: MetricsInstance diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index ecd64d046c..8e1522d85c 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -633,6 +633,8 @@ monitoring: tlsConfig: null # -- If defined, will create a MetricsInstance for the Grafana Agent Operator. metricsInstance: + # -- If enabled, MetricsInstance resources for Grafana Agent Operator are created + enabled: true # -- MerticsInstance annotations annotations: {} # -- Additional MatricsInstance labels