I am trying to install grafana helm chart with opsgenie notification like so
helm install stable/grafana -n grafana --namespace monitoring --set-string notifiers."notifiers\.yaml"="notifiers:
- name: opsgenie-notifier
type: opsgenie
uid: notifier-1
settings:
apiKey: some-key
apiUrl: https://some-server/alerts"
When I check the config map I see the value is set with an extra pipe at the begining --> |-
apiVersion: v1
data:
notifiers.yaml: |
|-
notifiers:
- name: opsgenie-notifier
type: opsgenie
uid: notifier-1
settings:
apiKey: some-key
apiUrl: https://some-server/alerts
kind: ConfigMap
metadata:
creationTimestamp: "2019-08-27T00:32:40Z"
labels:
app: grafana
chart: grafana-3.5.10
heritage: Tiller
release: grafana
name: grafana
namespace: monitoring
Checking the source code - https://github.com/helm/charts/blob/master/stable/grafana/templates/configmap.yaml, I can't figure out why. The below source code should print the values verbatim but its adding an extra line --> |-, causing grafana server to crash as it is unable to read the configuration.
{{- if .Values.notifiers }}
{{- range $key, $value := .Values.notifiers }}
{{ $key }}: |
{{ toYaml $value | indent 4 }}
{{- end -}}
{{- end -}}
I have tried with --set, --set-file and --set-string. Its the same behavio.