From 8a82aa613a5a10c7460424b65e919566c31cf43f Mon Sep 17 00:00:00 2001 From: Robert Choi Date: Thu, 9 Aug 2018 17:07:58 +0900 Subject: [PATCH] Prometheus-alertmanager: modify wrong variables This PS fixes following things: - fix wrong variable 'alertmanager_templats' to 'alert_templates' - remove 'toYaml' function for alert_templates - create alertmanager config in default location Change-Id: I4862435441b8a36f9d0ce4ff32667e8412ea3c14 --- prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl | 2 +- prometheus-alertmanager/templates/configmap-etc.yaml | 6 ++++-- prometheus-alertmanager/templates/statefulset.yaml | 4 ++-- prometheus-alertmanager/values.yaml | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl b/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl index 26f6a9183..f45b4842a 100644 --- a/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl +++ b/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl @@ -21,7 +21,7 @@ COMMAND="${@:-start}" function start () { exec /bin/alertmanager \ - -config.file=/etc/config/alertmanager.yml \ + -config.file=/etc/alertmanager/config.yml \ -storage.path={{ .Values.conf.command_flags.storage.path }} \ -mesh.listen-address={{ .Values.conf.command_flags.mesh.listen_address }} \ $(generate_peers) diff --git a/prometheus-alertmanager/templates/configmap-etc.yaml b/prometheus-alertmanager/templates/configmap-etc.yaml index 00517a079..b1d04dbf1 100644 --- a/prometheus-alertmanager/templates/configmap-etc.yaml +++ b/prometheus-alertmanager/templates/configmap-etc.yaml @@ -22,8 +22,10 @@ kind: ConfigMap metadata: name: alertmanager-etc data: - alertmanager.yml: | + config.yml: | {{ toYaml .Values.conf.alertmanager | indent 4 }} alert-templates.tmpl: | -{{ toYaml .Values.conf.alert_templates | indent 4 }} +{{- if .Values.conf.alert_templates }} +{{ .Values.conf.alert_templates | indent 4 }} +{{- end }} {{- end }} diff --git a/prometheus-alertmanager/templates/statefulset.yaml b/prometheus-alertmanager/templates/statefulset.yaml index c1779b02c..403f54ce2 100644 --- a/prometheus-alertmanager/templates/statefulset.yaml +++ b/prometheus-alertmanager/templates/statefulset.yaml @@ -101,8 +101,8 @@ spec: subPath: alert-templates.tmpl readOnly: true - name: alertmanager-etc - mountPath: /etc/config/alertmanager.yml - subPath: alertmanager.yml + mountPath: /etc/alertmanager/config.yml + subPath: config.yml readOnly: true - name: alertmanager-bin mountPath: /tmp/alertmanager.sh diff --git a/prometheus-alertmanager/values.yaml b/prometheus-alertmanager/values.yaml index d9268a3b5..6988e4118 100644 --- a/prometheus-alertmanager/values.yaml +++ b/prometheus-alertmanager/values.yaml @@ -297,4 +297,4 @@ conf: room_id: 85 message_format: html notify: true - alertmanager_templates: null + alert_templates: null