你好,notification-manager升级到0.6.0版本后,配置的webhook通知,但是好像没生效。还是走的email通道告警,麻烦指导下,感谢!
如下是我的配置:
notification-manager中已指定了新的镜像,defaultConfigSelector匹配type是default,globalReceiverSelector匹配global:
`[root@w6 samples]# kubectl -n kubesphere-monitoring-system get webhookconfig -l type=default -o yaml
apiVersion: v1
items:
- apiVersion: notification.kubesphere.io/v1alpha1
kind: WebhookConfig
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{“apiVersion”:“notification.kubesphere.io/v1alpha1”,“kind”:“WebhookConfig”,“metadata”:{“annotations”:{},“labels”:{“type”:“default”},“name”:“default-webhook-config”,“namespace”:“kubesphere-monitoring-system”},“spec”:{“url”:“http://alerts/home360”}}
creationTimestamp: “2020-11-18T06:23:41Z”
generation: 1
labels:
type: default
name: default-webhook-config
namespace: kubesphere-monitoring-system
resourceVersion: “102019338”
selfLink: /apis/notification.kubesphere.io/v1alpha1/namespaces/kubesphere-monitoring-system/webhookconfigs/default-webhook-config
uid: 2c7c44ed-d249-4bcc-ab08-5827416b705e
spec:
url: http://alerts/home360
kind: List
metadata:
resourceVersion: ""
selfLink: ""`
`[root@w6 samples]# kubectl -n kubesphere-monitoring-system get webhookreceivers.notification.kubesphere.io -l type=global -o yaml
apiVersion: v1
items:
- apiVersion: notification.kubesphere.io/v1alpha1
kind: WebhookReceiver
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{“apiVersion”:“notification.kubesphere.io/v1alpha1”,“kind”:“WebhookReceiver”,“metadata”:{“annotations”:{},“labels”:{“type”:“global”},“name”:“admin-webhook”,“namespace”:“kubesphere-monitoring-system”},“spec”:{“webhookConfigSelector”:{“matchLabels”:{“type”:“default”}}}}
creationTimestamp: “2020-11-18T06:25:24Z”
generation: 1
labels:
type: global
name: admin-webhook
namespace: kubesphere-monitoring-system
resourceVersion: “102019820”
selfLink: /apis/notification.kubesphere.io/v1alpha1/namespaces/kubesphere-monitoring-system/webhookreceivers/admin-webhook
uid: b4548556-d251-430c-89de-574e73f03da9
spec:
webhookConfigSelector:
matchLabels:
type: default
kind: List
metadata:
resourceVersion: ""
selfLink: ""`
但是界面还是通知渠道还是邮件,而且告警消息还是发送到邮件了。麻烦看下需要更改什么地方才能正确调用webhook,感谢!