diff --git a/jsonnet/kube-prometheus/alertmanager/alertmanager.libsonnet b/jsonnet/kube-prometheus/alertmanager/alertmanager.libsonnet index a9e9c03781d4c72672487bb6b8a125605f50826b..ad3fb0e89bcb4271364107fa3d90313cce76a994 100644 --- a/jsonnet/kube-prometheus/alertmanager/alertmanager.libsonnet +++ b/jsonnet/kube-prometheus/alertmanager/alertmanager.libsonnet @@ -14,22 +14,31 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; alertmanager+:: { name: $._config.alertmanager.name, - config: ||| - global: - resolve_timeout: 5m - route: - group_by: ['job'] - group_wait: 30s - group_interval: 5m - repeat_interval: 12h - receiver: 'null' - routes: - - match: - alertname: DeadMansSwitch - receiver: 'null' - receivers: - - name: 'null' - |||, + config: { + global: { + resolve_timeout: '5m', + }, + route: { + group_by: ['job'], + group_wait: '30s', + group_interval: '5m', + repeat_interval: '12h', + receiver: 'null', + routes: [ + { + receiver: 'null', + match: { + alertname: 'DeadMansSwitch', + }, + }, + ], + }, + receivers: [ + { + name: 'null', + }, + ], + }, replicas: 3, }, }, @@ -38,7 +47,7 @@ local k = import 'ksonnet/ksonnet.beta.3/k.libsonnet'; secret: local secret = k.core.v1.secret; - secret.new('alertmanager-' + $._config.alertmanager.name, { 'alertmanager.yaml': std.base64($._config.alertmanager.config) }) + + secret.new('alertmanager-' + $._config.alertmanager.name, { 'alertmanager.yaml': std.base64(std.manifestYamlDoc($._config.alertmanager.config)) }) + secret.mixin.metadata.withNamespace($._config.namespace), serviceAccount: