进入路径
cd /root/kube-prometheus/manifests
修改配置
[root@aws-k8s-manager manifests]# cp alertmanager-secret.yaml alertmanager-secret.yaml.bak
[root@aws-k8s-manager manifests]# cat > alertmanager-secret.yaml <<eof
apiVersion: v1
kind: Secret
metadata:
labels:
app.kubernetes.io/component: alert-router
app.kubernetes.io/instance: main
app.kubernetes.io/name: alertmanager
app.kubernetes.io/part-of: kube-prometheus
app.kubernetes.io/version: 0.25.0
name: alertmanager-main
namespace: monitoring
stringData:
alertmanager.yaml: |-
"global":
"resolve_timeout": "5m"
"wechat_api_url": "https://qyapi.weixin.qq.com/cgi-bin/"
"route":
"group_by":
- "namespace"
"group_interval": "5m"
"group_wait": "30s"
"receiver": "weixin"
"repeat_interval": "4h"
"routes":
- "matchers":
- "severity = critical|warning|info"
"receiver": "weixin"
"receivers":
- "name": "weixin"
"wechat_configs":
- "corp_id": "你的corp_id"
"to_party": "9|11"
"to_user": "you user"
"agent_id": "1000007"
"api_secret": "你的api_secret"
"send_resolved": true
"message": '{{ template "wechat.default.message" . }}'
type: Opaque
eof
标签:alertmanager,k8s,报警,secret,manifests,yaml,prometheus,kube,root
From: https://blog.51cto.com/yht1990/6362556