try to fix prometheus

try to fix prometheus 2

try to fix prometheus 3
This commit is contained in:
Aaron Riedel 2023-08-30 21:32:18 +02:00
parent ffaf6a079e
commit 778306127f
Signed by: aaron
GPG key ID: 643004654D40D577
2 changed files with 20 additions and 12 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

@ -2,12 +2,14 @@ alertmanager:
alertmanagerSpec: alertmanagerSpec:
replicas: 2 replicas: 2
secrets: secrets:
- telegram-api - "telegram-api"
configMaps:
- "templates"
config: config:
global: global:
resolve_timeout: 5m resolve_timeout: 5m
templates: templates:
- '/etc/alertmanager/config/*.tmpl' - '/etc/alertmanager/configmaps/*.tmpl'
route: route:
group_by: ['alertname'] group_by: ['alertname']
group_wait: 30s group_wait: 30s
@ -36,16 +38,6 @@ alertmanager:
target_matchers: target_matchers:
- severity = warning - severity = warning
equal: ['alertname', 'server', 'instance'] 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:
@ -53,6 +45,7 @@ alertmanager:
resources: resources:
requests: requests:
storage: 5Gi storage: 5Gi
useExistingSecret: false
ingress: ingress:
paths: paths:
- / - /