apiVersion: v1
kind: ConfigMap
metadata:
  name: alertmanager-config
  namespace: monitoring
  labels:
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: EnsureExists
data:
  alertmanager.yml: |
    global:
      resolve_timeout: 3m #解析的超时时间
      smtp_smarthost: 'smtp.yeah.net:25'
      smtp_from: 'xxx@yeah.net'
      smtp_auth_username: 'xxx@yeah.net'
      smtp_auth_password: 'xxx'
      smtp_require_tls: true
    route:
      group_by: ['example']
      group_wait: 60s
      group_interval: 60s
      repeat_interval: 10m
      receiver: 'mail'
    
    receivers:
    - name: 'mail'
      email_configs:
      - to: 'xxxx@qq.com'
        headers: { Subject: "[WARN] 报警邮件"}   # 接收邮件的标题
        send_resolved: true
      webhook_configs:
      - url: http://prod-monitoring-service/monitoring
        send_resolved: true
