monitoring: enable discord notifications

This commit is contained in:
2025-12-01 20:10:03 -05:00
parent ae8f0e560a
commit e7fb07343c
3 changed files with 91 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
apiVersion: external-secrets.io/v1
kind: ExternalSecret
metadata:
name: discord-webhook
namespace: {{ .Release.Namespace }}
spec:
refreshInterval: 1h
secretStoreRef:
name: weyma-vault
kind: ClusterSecretStore
target:
name: discord-webhook
creationPolicy: Owner
data:
- secretKey: webhook
remoteRef:
key: monitoring
property: discord_webhook

View File

@@ -0,0 +1,66 @@
{{- if .Values.discord.enabled }}
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: alertmanager-discord
namespace: {{ .Release.Namespace }}
labels:
app.kubernetes.io/name: alertmanager-discord
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: alertmanager-discord
template:
metadata:
labels:
app: alertmanager-discord
spec:
containers:
- name: alertmanager-discord
image: {{ .Values.discord.image | default "ghcr.io/rogerrum/alertmanager-discord:1.0.7" }}
ports:
- containerPort: 9094
env:
- name: LISTEN_ADDRESS
value: "0.0.0.0:9094"
- name: DISCORD_WEBHOOK
valueFrom:
secretKeyRef:
name: {{ .Values.discord.secret.name | quote }}
key: {{ .Values.discord.secret.key | quote }}
{{- if .Values.discord.username }}
- name: DISCORD_USERNAME
value: {{ .Values.discord.username | quote }}
{{- end }}
{{- if .Values.discord.avatar_url }}
- name: DISCORD_AVATAR_URL
value: {{ .Values.discord.avatar_url | quote }}
{{- end }}
{{- if .Values.discord.verbose }}
- name: VERBOSE
value: "ON"
{{- end }}
resources:
requests:
memory: "128Mi"
cpu: "500m"
limits:
memory: "512Mi"
cpu: "1"
---
apiVersion: v1
kind: Service
metadata:
name: alertmanager-discord
namespace: {{ .Release.Namespace }}
spec:
type: ClusterIP
selector:
app: alertmanager-discord
ports:
- port: 9094
targetPort: 9094
protocol: TCP
{{- end }}

View File

@@ -40,3 +40,9 @@ kube-prometheus-stack:
storage: 50Gi storage: 50Gi
grafana: grafana:
enabled: false # Grafana is instead deployed in its own namespace in the core-apps repo enabled: false # Grafana is instead deployed in its own namespace in the core-apps repo
discord:
enabled: true
secret:
name: discord-webhook
key: webhook
verbose: true