apiVersion: apps/v1
kind: Deployment
metadata:
  name: alertmanager-discord
  labels:
    app: alertmanager-discord
spec:
  selector:
    matchLabels:
      app: alertmanager-discord
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        prometheus.io/scrape: 'true'
        prometheus.io/path: /__/metrics
        prometheus.io/port: '8081'
        health.dsb.dev/scrape: 'true'
      labels:
        app: alertmanager-discord
    spec:
      imagePullSecrets:
      - name: registry
      containers:
      - image: ghcr.io/davidsbond/homelab:latest
        imagePullPolicy: IfNotPresent
        name: alertmanager-discord
        command:
        - /bin/alertmanager-discord
        env:
        - name: TRACER_DISABLED
          value: "true"
        - name: DISCORD_WEBHOOK_URL
          valueFrom:
            secretKeyRef:
              key: webhook.url
              name: discord
        - name: MONITORING_DSN
          valueFrom:
            secretKeyRef:
              key: sentry.dsn
              name: sentry
        readinessProbe:
          httpGet:
            path: /__/health
            port: 8081
          initialDelaySeconds: 5
