apiVersion: v1
kind: Secret
metadata:
  name: alertmanager-sa
type: Opaque
stringData:
  alertmanager.yaml: |-
    global:
      resolve_timeout: 5m
      http_config:
        proxy_url: http://9.111.208.201:3128
    route:
      group_by: ['job']
      group_wait: 30s
      group_interval: 5m
      repeat_interval: 12h
      receiver: 'slack_webhook'
      routes:
      - match:
          alertname: DeadMansSwitch
        receiver: 'null'
    receivers:
    - name: slack_webhook
      slack_configs:
      - send_resolved: false
        api_url: https://hooks.slack.com/services/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
        channel: '#j2c-platform-alerts'
        username: '{{ template "slack.default.username" . }}'
        color: '{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}'
        title: '{{ template "slack.default.title" . }}'
        title_link: '{{ template "slack.default.titlelink" . }}'
        # pretext: '{{ template "slack.default.pretext" . }}'
        # text: '{{ template "slack.default.text" . }}'
        pretext: '{{ .CommonAnnotations.summary }}'
        text: |-
          {{ range .Alerts }}
          *Alert:* {{ .Annotations.summary }} - `{{ .Labels.severity }}`
          *Description:* {{ .Annotations.description }}
          *Details:*
          {{ range .Labels.SortedPairs }} • *{{ .Name }}:* `{{ .Value }}`
          {{ end }}
          {{ end }}
        fallback: '{{ template "slack.default.fallback" . }}'
        icon_emoji: '{{ template "slack.default.iconemoji" . }}'
        icon_url: '{{ template "slack.default.iconurl" . }}'
    - name: 'null'
    templates: []
