apiVersion: v1
kind: ConfigMap
metadata:
  name: k8s-pgmon-alertmanager-config-wechat
  namespace: pgmon
  labels:
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: EnsureExists
data:
  alertmanager.yml: |
    global:
      resolve_timeout: 2m
      wechat_api_url: 'https://qyapi.weixin.qq.com/cgi-bin/'
    route:
      group_by: ['alert']
      group_wait: 10s
      group_interval: 1m
      repeat_interval: 1h
      receiver: wechat
    receivers:
    - name: 'wechat'
      wechat_configs:
      - api_secret: 'xxxxxxxxx'
        send_resolved: true
        to_user: '@all'
        to_party: 'marksugar'
        agent_id: '100000X'
        corp_id: 'ww0164xxxxx'
    templates:
      - '/etc/config/alert/wechat.tmpl'
    inhibit_rules:
      - source_match:
          severity: 'critical'
        target_match:
          severity: 'warning'
        equal: ['alertname', 'dev', 'instance'] 
