From 2bdf4f8239045c18a4e9a533984d3f90c747509f Mon Sep 17 00:00:00 2001 From: Steven Fitzpatrick Date: Wed, 30 Sep 2020 23:54:15 +0000 Subject: [PATCH] Add extensible command line flags to Alertmanager Alertmanager is configured similarly to Prometheus. This change brings the utils.command_line_flags template from the osh-infra prometheus chart to Alertmanager, allowing these flags to be configured in Values.yaml Change-Id: Ieca94c09881bc52b62500efa4c6f8730b9208d3b --- prometheus-alertmanager/Chart.yaml | 2 +- prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl | 6 ++++-- prometheus-alertmanager/values.yaml | 6 ++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/prometheus-alertmanager/Chart.yaml b/prometheus-alertmanager/Chart.yaml index b2ac648a2..abd0284d3 100644 --- a/prometheus-alertmanager/Chart.yaml +++ b/prometheus-alertmanager/Chart.yaml @@ -15,7 +15,7 @@ apiVersion: v1 appVersion: v0.20.0 description: OpenStack-Helm Alertmanager for Prometheus name: prometheus-alertmanager -version: 0.1.1 +version: 0.1.2 home: https://prometheus.io/docs/alerting/alertmanager/ sources: - https://github.com/prometheus/alertmanager diff --git a/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl b/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl index b211fb0dd..1838a05ca 100644 --- a/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl +++ b/prometheus-alertmanager/templates/bin/_alertmanager.sh.tpl @@ -20,8 +20,10 @@ COMMAND="${@:-start}" function start () { exec /bin/alertmanager \ --config.file=/etc/alertmanager/config.yml \ - --storage.path={{ .Values.conf.command_flags.alertmanager.storage.path }} \ - --cluster.listen-address={{ .Values.conf.command_flags.alertmanager.cluster.listen_address }} \ +{{- range $flag, $value := .Values.conf.command_flags.alertmanager }} +{{- $flag := $flag | replace "_" "-" }} +{{ printf "--%s=%s" $flag $value | indent 4 }} \ +{{- end }} $(generate_peers) } diff --git a/prometheus-alertmanager/values.yaml b/prometheus-alertmanager/values.yaml index fcc3282db..54845d058 100644 --- a/prometheus-alertmanager/values.yaml +++ b/prometheus-alertmanager/values.yaml @@ -250,10 +250,8 @@ network_policy: conf: command_flags: alertmanager: - storage: - path: /var/lib/alertmanager/data - cluster: - listen_address: "0.0.0.0:9094" + storage.path: /var/lib/alertmanager/data + cluster.listen_address: "0.0.0.0:9094" snmpnotifier: alert_default_severity: crititcal alert_severities: "critical,warning,info,page"