• 告警通知
  • webhook(企业微信机器人)无法收到消息

NullFox 生产环境是在2022年使用kubesphere-installer.yaml创建的,使用阿里云ACK托管版本。我现在本地虚拟机加了一个版本一样,也是v3.1.1,但使用是kk方式部署的

NullFox [root@node1 kubernetes]# helm upgrade notification-manager -n kubesphere-monitoring-system notification-manager.tgz

Error: UPGRADE FAILED: rendered manifests contain a resource that already exists. Unable to continue with update: Secret “notification-manager-webhook-server-cert” in namespace “kubesphere-monitoring-system” exists and cannot be imported into the current release: invalid ownership metadata; label validation error: missing key “app.kubernetes.io/managed-by”: must be set to “Helm”; annotation validation error: missing key “meta.helm.sh/release-name”: must be set to “notification-manager”; annotation validation error: missing key “meta.helm.sh/release-namespace”: must be set to “kubesphere-monitoring-system”

[root@node1 kubernetes]#

kubectl edit nm notification-manager

修改defaultSecretNamespace

defaultSecretNamespace: kubesphere-monitoring-federated

    wanjunlei

    apiVersion: notification.kubesphere.io/v2beta2

    kind: NotificationManager

    metadata:

    annotations:

    kubectl.kubernetes.io/last-applied-configuration: |
    
      {"apiVersion":"notification.kubesphere.io/v2beta2","kind":"NotificationManager","metadata":{"annotations":{},"name":"notification-manager"},"spec":{"defaultConfigSelector":{"matchLabels":{"type":"default"}},"groupLabels":["alertnam

    creationTimestamp: “2024-06-13T09:05:33Z”

    generation: 1

    name: notification-manager

    resourceVersion: “22697”

    uid: 7b941c5a-2d69-4356-9762-d68d41df7d7e

    spec:

    batchMaxSize: 100

    batchMaxWait: 1m

    defaultConfigSelector:

    matchLabels:
    
      type: default

    groupLabels:

    • alertname

    • namespace

      image: kubesphere/notification-manager:v2.2.0

      imagePullPolicy: Always

      portName: webhook

      receivers:

      globalReceiverSelector:

      matchLabels:

      type: global

    options:

      dingtalk:
    
        notificationTimeout: 5
    
      email:
    
        notificationTimeout: 5
    
      slack:
    
        notificationTimeout: 5
    
      webhook:
    
        notificationTimeout: 5
    
      wechat:
    
        notificationTimeout: 5
    
    tenantKey: user
    
    tenantReceiverSelector:
    
      matchLabels:
    
        type: tenant

    replicas: 1

    resources:

    limits:
    
      cpu: 500m
    
      memory: 1Gi
    
    requests:
    
      cpu: 100m
    
      memory: 20Mi

    routePolicy: All

    serviceAccountName: notification-manager-sa

    template:

    language: English
    
    reloadCycle: 1m
    
    text:
    
      name: notification-manager-template
    
      namespace: kubesphere-monitoring-system

    - /tmp/kubectl-edit-p0a83.yaml 62/62 100%

    没有您说这个属性耶

    wanjunlei 加上是可以收到邮件和钉钉通知,但好像企业微信收不到。现在升级的版本支持企业微信机器人通知的吗

    目前企业微信配置的是企业应用通知,报IP异常,好像是说要开放IP

    wechat.go:261 msg=“WechatNotifier: wechat response error” code=60020 message=“not allow to access from your ip, hint: [1718329557591812177611153], from ip: 113.67.179.20, more info at https://open.work.weixin.qq.com/devtool/query?e=60020” from=1000002 toUser= toParty=2 toTag=

    wanjunlei 开放IP这种方式太麻烦了,IP也没有固定,可以配置企业微信机器人的方式吗

    NullFox 企业微信机器人通知,按照你们的步骤可以了,感谢。
    有另外一个问题在问一下,就是配置Webhook这种方式的话,请求接口有要求事Post方式还是怎样的吗?一般接收参数做是怎样的呢。而且这样配置怎么没有效果呀(配置webhook方式,主要是想跳一些比较重要的预警信息,自己去过滤拨打电话或短信)