[Helm] Add toggle for MetricsInstance (#7525)

Signed-off-by: Jan-Otto Kröpke <jok@cloudeteer.de>

**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:<nil>])
coalesce.go:220: warning: cannot overwrite table with non table for loki.monitoring.serviceMonitor.metricsInstance (map[annotations:map[] labels:map[] remoteWrite:<nil>])
coalesce.go:220: warning: cannot overwrite table with non table for loki.monitoring.serviceMonitor.metricsInstance (map[annotations:map[] labels:map[] remoteWrite:<nil>])
```

**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 <jok@cloudeteer.de>
pull/7565/head
Jan-Otto Kröpke 3 years ago committed by GitHub
parent daad5bb812
commit 9e300baf89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 10
      docs/sources/installation/helm/reference.md
  2. 2
      production/helm/loki/templates/monitoring/metrics-instance.yaml
  3. 2
      production/helm/loki/values.yaml

@ -1968,6 +1968,7 @@ null
<td><pre lang="json">
{
"annotations": {},
"enabled": true,
"labels": {},
"remoteWrite": null
}
@ -1981,6 +1982,15 @@ null
<td><pre lang="json">
{}
</pre>
</td>
</tr>
<tr>
<td>monitoring.serviceMonitor.metricsInstance.enabled</td>
<td>bool</td>
<td>If enabled, MetricsInstance resources for Grafana Agent Operator are created</td>
<td><pre lang="json">
true
</pre>
</td>
</tr>
<tr>

@ -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

@ -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

Loading…
Cancel
Save