---
apiVersion: v1
kind: ConfigMap
metadata:
  name: alertmanager-default
  namespace: monitoring-system
data:
  values.yaml: |
    fullnameOverride: alertmanager
    operator:
      enabled: false
    prometheus:
      enabled: false
    alertmanager:
      enabled: true
      config:
        global:
          smtp_from: "alert@das-schiff.io"
          smtp_hello: "alert@das-schiff.io"
          smtp_smarthost: <default_ip:ip_address>
        receivers:
        - name: 'null'
        - name: 'platform'
          email_configs:
          - to: user1@das-schiff.io
            send_resolved: true
          - to: user2@das-schiff.io
            send_resolved: true
          - to: mailing-list@das-schiff.io
            send_resolved: true
          - to: user3@das-schiff.io
            send_resolved: true
        route:
          receiver: 'platform'
          group_wait: 30s
          group_interval: 5m
          repeat_interval: 24h
          group_by: ['...']
          routes:
          - match:
              alertname: Watchdog
            receiver: 'null'
          - match_re:
              # Ignore everything which start with the prefix `Wat`
              # This can be changed when alertmanager v0.22.0 gets released.
              # then it gets negative regex support
              alertname: '^(?:[A-V]|[X-Z]|[a-v]|[x-z])(?:[B-Z]|[b-z])(?:[A-S]|[U-Z]|[a-s]|[u-z]).*?$'
            group_by: [alertname, namespace]
            routes:
            - match_re:
                namespace: '.*?-system'
              receiver: 'platform'
            - match_re:
                # Ignore everything which ends on suffix `tem`
                # This can be changed when alertmanager v0.22.0 gets released.
                # then it gets negative regex support
                namespace: '^.*?([a-s]|[u-z])([a-d]|[f-z])([a-l]|[n-z])$'
              receiver: 'null'
      replicaCount: 3
      ## Alertmanager StorageSpec for persistent data
      ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/storage.md
      ##
      storageSpec:
        emptyDir:
          medium: ""
        # volumeClaimTemplate:
          ## after https://github.com/coreos/prometheus-operator/pull/3049 gets introduced
          ## in a new version these two lines can be readded
          # apiVersion: v1
          # kind: PersistentVolumeClaim
          # spec:
          #   accessModes:
          #   - ReadWriteOnce
          #   resources:
          #     requests:
          #       storage: 2Gi
          #   storageClassName: "<storage_class_name>"
    exporters:
      enabled: false
      node-exporter:
        enabled: false
      kube-state-metrics:
        enabled: false
    coreDns:
      enabled: false
    kubeScheduler:
      enabled: false
    kubeApiServer:
      enabled: false
    kubeControllerManager:
      enabled: false
    kubeProxy:
      enabled: false
    kubelet:
      enabled: false