diff --git a/k8s/core/prom-stack/grafana-alerting.yaml b/k8s/core/prom-stack/grafana-alerting.yaml
deleted file mode 100644
index ca00996..0000000
--- a/k8s/core/prom-stack/grafana-alerting.yaml
+++ /dev/null
@@ -1,69 +0,0 @@
-rules.yaml: |
- apiVersion: 1
- groups:
- - orgId: 1
- name: pasarguard_alerts
- folder: Kubernetes
- interval: 1m
- rules:
- - uid: pasarguard_cpu_throttling
- title: VPN CPU Throttle
- condition: A
- data:
- - refId: A
- relativeTimeRange:
- from: 600
- to: 0
- datasourceUid: prometheus
- model:
- expr: 'rate(container_cpu_cfs_throttled_periods_total{container="pasarguard-node"}[5m]) > 0.1'
- refId: A
- noDataState: NoData
- execErrState: Alerting
- for: 5m
- annotations:
- description: 'Throttling rate: {{ printf "%.2f" $values.A.Value }}'
- summary: 'VPN node throttling CPU on {{ $labels.node }}'
- labels:
- severity: warning
-
-contactpoints.yaml: |
- apiVersion: 1
- contactPoints:
- - orgId: 1
- name: telegram
- receivers:
- - uid: telegram_default
- type: telegram
- settings:
- bottoken: $TELEGRAM_BOT_TOKEN
- chatid: $TELEGRAM_CHAT_ID
- message: |
- {{ if eq .Status "firing" }}🔥 FIRING{{ else }}✅ RESOLVED{{ end }}
-
- {{ range .Alerts }}
- 📊 {{ .Labels.alertname }}
- {{ if .Annotations.summary }}{{ .Annotations.summary }}{{ end }}
-
- 🎯 Details:
- • Pod: {{ .Labels.pod }}
- • Node: {{ .Labels.node }}
- • Namespace: {{ .Labels.namespace }}
- {{ if .Annotations.description }}• {{ .Annotations.description }}{{ end }}
-
- 🔗 View in Grafana
- {{ end }}
- parse_mode: HTML
- disableResolveMessage: false
-
-policies.yaml: |
- apiVersion: 1
- policies:
- - orgId: 1
- receiver: telegram
- group_by:
- - grafana_folder
- - alertname
- group_wait: 10s
- group_interval: 5m
- repeat_interval: 4h
diff --git a/k8s/core/prom-stack/grafana-values.yaml b/k8s/core/prom-stack/grafana-values.yaml
index 2fae72b..9f806ec 100644
--- a/k8s/core/prom-stack/grafana-values.yaml
+++ b/k8s/core/prom-stack/grafana-values.yaml
@@ -57,9 +57,20 @@ ingress:
- '*.hexor.cy'
extraConfigmapMounts:
- - name: grafana-alerting
- mountPath: /etc/grafana/provisioning/alerting
+ - name: grafana-alerting-rules
+ mountPath: /etc/grafana/provisioning/alerting/rules.yaml
configMap: grafana-alerting
+ subPath: rules.yaml
+ readOnly: true
+ - name: grafana-alerting-contactpoints
+ mountPath: /etc/grafana/provisioning/alerting/contactpoints.yaml
+ configMap: grafana-alerting
+ subPath: contactpoints.yaml
+ readOnly: true
+ - name: grafana-alerting-policies
+ mountPath: /etc/grafana/provisioning/alerting/policies.yaml
+ configMap: grafana-alerting
+ subPath: policies.yaml
readOnly: true
envValueFrom:
diff --git a/k8s/core/prom-stack/kustomization.yaml b/k8s/core/prom-stack/kustomization.yaml
index af2eb85..8c4e1e7 100644
--- a/k8s/core/prom-stack/kustomization.yaml
+++ b/k8s/core/prom-stack/kustomization.yaml
@@ -5,12 +5,7 @@ resources:
- app.yaml
- persistentVolume.yaml
- external-secrets.yaml
-
-configMapGenerator:
- - name: grafana-alerting
- namespace: prometheus
- files:
- - grafana-alerting.yaml
+ - grafana-alerting-configmap.yaml
helmCharts:
- name: kube-prometheus-stack