Compare commits

..

3 commits

Author SHA1 Message Date
94c2a34aac
try to fix prometheus 2 2023-08-31 00:29:12 +02:00
778306127f
try to fix prometheus
try to fix prometheus 2

try to fix prometheus 3
2023-08-30 22:56:03 +02:00
ffaf6a079e
put alertmanager config back into helm values 2023-08-30 21:27:13 +02:00
2 changed files with 53 additions and 1 deletions

15
prometheus/templates.yaml Normal file
View file

@ -0,0 +1,15 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: templates
namespace: prometheus
data:
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 }}

View file

@ -1,6 +1,10 @@
alertmanager: alertmanager:
alertmanagerSpec: alertmanagerSpec:
replicas: 2 replicas: 2
secrets:
- "telegram-api"
configMaps:
- "templates"
storage: storage:
volumeClaimTemplate: volumeClaimTemplate:
spec: spec:
@ -8,7 +12,40 @@ alertmanager:
resources: resources:
requests: requests:
storage: 5Gi storage: 5Gi
useExistingSecret: true useExistingSecret: false
config:
global:
resolve_timeout: 5m
templates:
- '/etc/alertmanager/configmaps/*.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']
ingress: ingress:
paths: paths:
- / - /