apiVersion: apps/v1
kind: Deployment
metadata:
  name: alertmanager-discord
  namespace: monitoring
  labels:
    app.kubernetes.io/name: alertmanager-discord
spec:
  replicas: 1
  strategy:
    type: Recreate
  selector:
    matchLabels:
      app.kubernetes.io/name: alertmanager-discord
  template:
    metadata:
      labels:
        app.kubernetes.io/name: alertmanager-discord
    spec:
      containers:
        - name: alertmanager-discord
          image: tyriis/alertmanager-discord-arm64:latest
          imagePullPolicy: IfNotPresent
          resources:
            requests:
              cpu: 50m
              memory: 250Mi
          ports:
            - name: http
              protocol: TCP
              containerPort: 9094
          livenessProbe:
            tcpSocket:
              port: http
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 15
          readinessProbe:
            tcpSocket:
              port: http
            initialDelaySeconds: 30
            timeoutSeconds: 5
            periodSeconds: 5
            successThreshold: 1
            failureThreshold: 15
          env:
            - name: DISCORD_WEBHOOK
              valueFrom:
                secretKeyRef:
                  name: monitoring-secrets
                  key: SECRET_ALERT_MANAGER_DISCORD_WEBHOOK
      # securityContext:
      #   runAsUser: 1000
      #   runAsGroup: 1000
      #   fsGroup: 1000
      #   fsGroupChangePolicy: "OnRootMismatch"