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
This commit is contained in:
Robert Choi 2018-08-09 17:07:58 +09:00
parent c0c5199fb2
commit 8a82aa613a
4 changed files with 8 additions and 6 deletions

View File

@ -21,7 +21,7 @@ COMMAND="${@:-start}"
function start () { function start () {
exec /bin/alertmanager \ exec /bin/alertmanager \
-config.file=/etc/config/alertmanager.yml \ -config.file=/etc/alertmanager/config.yml \
-storage.path={{ .Values.conf.command_flags.storage.path }} \ -storage.path={{ .Values.conf.command_flags.storage.path }} \
-mesh.listen-address={{ .Values.conf.command_flags.mesh.listen_address }} \ -mesh.listen-address={{ .Values.conf.command_flags.mesh.listen_address }} \
$(generate_peers) $(generate_peers)

View File

@ -22,8 +22,10 @@ kind: ConfigMap
metadata: metadata:
name: alertmanager-etc name: alertmanager-etc
data: data:
alertmanager.yml: | config.yml: |
{{ toYaml .Values.conf.alertmanager | indent 4 }} {{ toYaml .Values.conf.alertmanager | indent 4 }}
alert-templates.tmpl: | alert-templates.tmpl: |
{{ toYaml .Values.conf.alert_templates | indent 4 }} {{- if .Values.conf.alert_templates }}
{{ .Values.conf.alert_templates | indent 4 }}
{{- end }}
{{- end }} {{- end }}

View File

@ -101,8 +101,8 @@ spec:
subPath: alert-templates.tmpl subPath: alert-templates.tmpl
readOnly: true readOnly: true
- name: alertmanager-etc - name: alertmanager-etc
mountPath: /etc/config/alertmanager.yml mountPath: /etc/alertmanager/config.yml
subPath: alertmanager.yml subPath: config.yml
readOnly: true readOnly: true
- name: alertmanager-bin - name: alertmanager-bin
mountPath: /tmp/alertmanager.sh mountPath: /tmp/alertmanager.sh

View File

@ -297,4 +297,4 @@ conf:
room_id: 85 room_id: 85
message_format: html message_format: html
notify: true notify: true
alertmanager_templates: null alert_templates: null