feat(monitoring): Grafana alerting → Telegram for homelab
- Secret grafana-telegram: bot token + chat ID (env var injection)
- ConfigMap grafana-alerting: provisioning files for contact point,
notification policy, and 4 alert rules
* Pod CrashLoopBackOff (for: 1m, noData: OK)
* Disk > 80% on non-tmpfs filesystems (for: 5m)
* RAM > 85% (for: 5m)
* Pod Failed/Unknown (for: 3m, noData: OK)
- Deployment: TELEGRAM_* env vars from secret + alerting volume mount
Token interpolated via ${TELEGRAM_BOT_TOKEN} in provisioning YAML.
This commit is contained in:
@@ -152,6 +152,16 @@ spec:
|
||||
value: /etc/grafana/provisioning
|
||||
- name: GF_UNIFIED_STORAGE_INDEX_PATH
|
||||
value: /var/lib/grafana-search/bleve
|
||||
- name: TELEGRAM_BOT_TOKEN
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: grafana-telegram
|
||||
key: TELEGRAM_BOT_TOKEN
|
||||
- name: TELEGRAM_CHAT_ID
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: grafana-telegram
|
||||
key: TELEGRAM_CHAT_ID
|
||||
image: docker.io/grafana/grafana:12.4.2
|
||||
imagePullPolicy: IfNotPresent
|
||||
livenessProbe:
|
||||
@@ -213,6 +223,8 @@ spec:
|
||||
subPath: provider.yaml
|
||||
- mountPath: /etc/grafana/provisioning/datasources
|
||||
name: sc-datasources-volume
|
||||
- mountPath: /etc/grafana/provisioning/alerting
|
||||
name: grafana-alerting
|
||||
dnsPolicy: ClusterFirst
|
||||
enableServiceLinks: true
|
||||
initContainers:
|
||||
@@ -270,4 +282,8 @@ spec:
|
||||
name: sc-dashboard-provider
|
||||
- emptyDir: {}
|
||||
name: sc-datasources-volume
|
||||
- configMap:
|
||||
defaultMode: 420
|
||||
name: grafana-alerting
|
||||
name: grafana-alerting
|
||||
|
||||
|
||||
Reference in New Issue
Block a user