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

NullFox

现在配置企业微信,创建应用的方式一直出错。我们两年前用的v3.1.1版本,现在项目太多,也不知道升级会不会影响到

    NullFox 大佬,像我们现在使用kubesphere/notification-manager:v1.0.0版本,有办法单独升级这个组件,支持企业微信通知吗。

    hanyce 您好,您这边使用什么kubesphere哪个版本,是在后台自己配置企业微信通知吗

    helloJackYang 企业微信之前他们更新过,然后需要设置什么ip白名单了,具体的你可以去看一下企微的文档。如果要使用企业微信机器人那得notification-manager 2.2版本以后才可以

      NullFox 可以单独升级notification-manager版本,并使用微信机器人通知的方式吗。目前是notification-manager:v1.0.0

      可以,不过你的数据重要的话,建议你先创建个测试集群先尝试一下。

        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%

          没有您说这个属性耶