diff --git a/core-deployments.yaml b/core-deployments.yaml
index 6e84d64..dc35495 100644
--- a/core-deployments.yaml
+++ b/core-deployments.yaml
@@ -98,7 +98,7 @@ spec:
sources:
- chart: kube-prometheus-stack
repoURL: https://prometheus-community.github.io/helm-charts
- targetRevision: 49.2.0
+ targetRevision: 51.0.3
helm:
releaseName: prometheus
valueFiles:
diff --git a/prometheus/templates.yaml b/prometheus/templates.yaml
new file mode 100644
index 0000000..6c8c408
--- /dev/null
+++ b/prometheus/templates.yaml
@@ -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"}}🔥 {{ .Labels.alertname }} 🔥{{ else }}✅ {{ .Labels.alertname }} ✅{{ end }}
+ {{ .Annotations.summary }}
+
+ {{ .Annotations.description }}
+ {{ end }}
+ {{ end }}
\ No newline at end of file
diff --git a/prometheus/values.yaml b/prometheus/values.yaml
index 650e76f..0906755 100644
--- a/prometheus/values.yaml
+++ b/prometheus/values.yaml
@@ -1,6 +1,10 @@
alertmanager:
alertmanagerSpec:
replicas: 2
+ secrets:
+ - "telegram-api"
+ configMaps:
+ - "templates"
storage:
volumeClaimTemplate:
spec:
@@ -8,7 +12,40 @@ alertmanager:
resources:
requests:
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:
paths:
- /