monitoring: enable discord notifications
This commit is contained in:
18
system-apps/monitoring/templates/discord-webhook-secret.yaml
Normal file
18
system-apps/monitoring/templates/discord-webhook-secret.yaml
Normal 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
|
||||||
66
system-apps/monitoring/templates/discord.yaml
Normal file
66
system-apps/monitoring/templates/discord.yaml
Normal 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 }}
|
||||||
@@ -39,4 +39,10 @@ kube-prometheus-stack:
|
|||||||
requests:
|
requests:
|
||||||
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
|
||||||
Reference in New Issue
Block a user