kube event 事件监控
阿里云 事件监控开源项目地址
https://github.com/AliyunContainerService/kube-eventer
需要对一下变量进行修改
--sink=dingtalk:[your_webhook_url]&label=[your_cluster_id]&level=[Normal or Warning(default)]
说明
your_cluster_id 字段用于钉钉的自定义关键词
python 钉钉 测试
import json
import requests
url = "https://oapi.dingtalk.com/robot/send?access_token=XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
header = {
"Content-Type": "application/json",
"charset": "utf-8"
}
data = {
"msgtype": "text",
"text": {
"content": "Newhope告警测试"
},
"at": {
"isAtAll": True # at为非必须
}
}
if __name__ == "__main__":
sendData = json.dumps(data)
request = requests.post(url, data=sendData, headers=header)
print(request.text)