put alertmanager config back into helm values

This commit is contained in:
Aaron Riedel 2023-08-30 21:27:13 +02:00
parent 80f5a5daa2
commit ffaf6a079e
Signed by: aaron
GPG key ID: 643004654D40D577

View file

@ -1,6 +1,51 @@
alertmanager: alertmanager:
alertmanagerSpec: alertmanagerSpec:
replicas: 2 replicas: 2
secrets:
- telegram-api
config:
global:
resolve_timeout: 5m
templates:
- '/etc/alertmanager/config/*.tmpl'
route:
group_by: ['alertname']
group_wait: 30s
group_interval: 30s
repeat_interval: 24h
receiver: 'tg1'
routes:
- matchers:
- severity=warning
receiver: 'tg1'
- matchers:
- severity=critical
receiver: 'tg1'
receivers:
- name: tg1
telegram_configs:
- bot_token_file: '/etc/alertmanager/secrets/api_key'
chat_id: -995270884
api_url: "https://api.telegram.org"
send_resolved: true
parse_mode: "HTML"
message: '{{ template "telegram.aaron" .}}'
inhibit_rules:
- source_matchers:
- severity = critical
target_matchers:
- severity = warning
equal: ['alertname', 'server', 'instance']
templateFiles:
telegram.tmpl: |-
{{ define "telegram.aaron" }}
{{ range .Alerts }}
{{ if eq .Status "firing"}}🔥 <b>{{ .Labels.alertname }}</b> 🔥{{ else }}✅ <b>{{ .Labels.alertname }}</b> ✅{{ end }}
<b> {{ .Annotations.summary }} </b>
{{ .Annotations.description }}
{{ end }}
{{ end }}
storage: storage:
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
@ -8,7 +53,6 @@ alertmanager:
resources: resources:
requests: requests:
storage: 5Gi storage: 5Gi
useExistingSecret: true
ingress: ingress:
paths: paths:
- / - /