flux alerting

This commit is contained in:
Lee 2024-09-22 02:30:42 +01:00
parent b9d8691969
commit 766fd809a8
5 changed files with 62 additions and 0 deletions

@ -0,0 +1,18 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: kubernetes-grafana-external-ingress
namespace: monitoring
annotations:
kubernetes.io/ingress.class: traefik-external
spec:
entryPoints:
- websecure
routes:
- match: Host(`kubernetes-grafana.local.fascinated.cc`)
kind: Rule
services:
- name: kube-prometheus-stack-grafana
port: 80
tls:
secretName: mcutils-xyz

@ -0,0 +1,19 @@
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Alert
metadata:
name: discord-alert
namespace: flux-system
spec:
summary: "Discord Alert"
# eventMetadata:
# env: "production"
# cluster: "my-cluster"
# region: "us-east-2"
providerRef:
name: discord-webhook
eventSeverity: info
eventSources:
- kind: GitRepository
name: "*"
- kind: Kustomization
name: "*"

@ -0,0 +1,18 @@
---
apiVersion: notification.toolkit.fluxcd.io/v1beta3
kind: Provider
metadata:
name: discord
namespace: flux-system
spec:
type: discord
secretRef:
name: discord-webhook
---
apiVersion: v1
kind: Secret
metadata:
name: discord-webhook
namespace: flux-system
stringData:
address: "https://discord.com/api/webhooks/1287224007820574841/4lZh3e3OxI6Qu0BnzyEBzbGBc3tdhzWG66Dh9t8RdVbenClhOOAnqooclrw1amRoY5nB"

@ -0,0 +1,6 @@
---
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- discord-secret.yaml
- alert.yaml

@ -4,3 +4,4 @@ kind: Kustomization
resources:
- crds
- nfs
- alerting/flux