Add alertmanager kubernetes sd into prometheus conf template

Change-Id: I60189136bcf7bc63346714f8c3f911cc6f863e09
Related-PROD: PROD-23277
This commit is contained in:
Ildar Svetlov 2018-09-24 13:32:01 +04:00
parent c9dadf7931
commit 707af19587

View file

@ -42,6 +42,15 @@ alerting:
- names: {{ alertmanager.dns_sd_configs.get('domain', [])|yaml }}
type: {{ alertmanager.dns_sd_configs.type }}
port: {{ alertmanager.dns_sd_configs.port }}
{%- elif alertmanager.kubernetes_sd_configs is defined %}
- kubernetes_sd_configs:
- role: {{ alertmanager.kubernetes_sd_configs.role }}
namespaces:
names: ['{{ alertmanager.kubernetes_sd_configs.namespace }}']
relabel_configs:
- source_labels: [__meta_kubernetes_pod_name]
action: keep
regex: {{ alertmanager.kubernetes_sd_configs.pod_name_regex }}
{%- endif %}
{%- endif %}
{%- endfor %}