• 告警通知
  • kubesphere 3.4.1 notification-manager2.3.0 修改notification-manager的工作负载配置不生效。

创建部署问题时,请参考下面模板,你提供的信息越多,越容易及时获得解答。
发帖前请点击 发表主题 右边的 预览(👀) 按钮,确保帖子格式正确。
你只花一分钟创建的问题,不能指望别人花上半个小时给你解答。

操作系统信息
例如:虚拟机/物理机,Centos7.5/Ubuntu18.04,4C/8G

Kubernetes版本信息
例如:v18.6。单节点还是多节点。

容器运行时
例如,使用 docker/containerd,版本多少

KubeSphere版本信息

kubesphere 3.4.1 k8s 1.22.12版本

安装的告警系统组件,修改通知模版之后测试提示模版未定义。

经排查发现**notification-manager这个deployment没有挂载模版的configmap,手动挂载不生效(无论是在可视化页面上还是通过编译yaml都不行)。

尝试修改notification-manager镜像版本为1.4.0也不生效。请问下各位大佬有遇到过这种情况吗?**

notification-manager-deployment的镜像配置要修改notificationmanger crd资源来修改

    NullFox 这个是没问题的,我也改了钉钉接收者的使用的模版啥的都能生效。但是模版的configmap没有挂在容器上。
    下面是3.4.1的notification-manager的yaml,并没有将模版挂载上去
    kind: Deployment

    apiVersion: apps/v1

    metadata:

    name: notification-manager-deployment

    namespace: kubesphere-monitoring-system

    labels:

    app: notification-manager
    
    notification-manager: notification-manager

    annotations:

    deployment.kubernetes.io/revision: '15'

    spec:

    replicas: 2

    selector:

    matchLabels:
    
      app: notification-manager
    
      notification-manager: notification-manager

    template:

    metadata:
    
      creationTimestamp: null
    
      labels:
    
        app: notification-manager
    
        notification-manager: notification-manager
    
    spec:
    
      containers:
    
        - name: notification-manager
    
          image: 'kubesphere/notification-manager:v2.3.0'
    
          args:
    
            - '--log.level=debug'
    
          ports:
    
            - name: webhook
    
              containerPort: 19093
    
              protocol: TCP
    
          env:
    
            - name: NAMESPACE
    
              value: kubesphere-monitoring-federated
    
          resources:
    
            limits:
    
              cpu: 500m
    
              memory: 500Mi
    
            requests:
    
              cpu: 5m
    
              memory: 20Mi
    
          terminationMessagePath: /dev/termination-log
    
          terminationMessagePolicy: File
    
          imagePullPolicy: IfNotPresent
    
      restartPolicy: Always
    
      terminationGracePeriodSeconds: 30
    
      dnsPolicy: ClusterFirst
    
      serviceAccountName: notification-manager-sa
    
      serviceAccount: notification-manager-sa
    
      securityContext: {}
    
      affinity: {}
    
      schedulerName: default-scheduler

    strategy:

    type: RollingUpdate
    
    rollingUpdate:
    
      maxUnavailable: 25%
    
      maxSurge: 25%

    revisionHistoryLimit: 10

    progressDeadlineSeconds: 600

    下面是3.3.0,notification-manager 1.4.0的yaml,就可以看到模版的configmap是被挂在了/etc下面

    kind: Deployment

    apiVersion: apps/v1

    metadata:

    name: notification-manager-deployment

    namespace: kubesphere-monitoring-system

    labels:

    app: notification-manager
    
    notification-manager: notification-manager

    annotations:

    deployment.kubernetes.io/revision: '3'

    spec:

    replicas: 2

    selector:

    matchLabels:
    
      app: notification-manager
    
      notification-manager: notification-manager

    template:

    metadata:
    
      creationTimestamp: null
    
      labels:
    
        app: notification-manager
    
        notification-manager: notification-manager
    
    spec:
    
      volumes:
    
        - name: host-time
    
          hostPath:
    
            path: /etc/localtime
    
            type: ''
    
        - name: notification-manager-template
    
          configMap:
    
            name: notification-manager-template
    
            defaultMode: 420
    
      containers:
    
        - name: notification-manager
    
          image: >-
    
            registry.cn-beijing.aliyuncs.com/kubesphereio/notification-manager:v1.4.0
    
          ports:
    
            - name: webhook
    
              containerPort: 19093
    
              protocol: TCP
    
          env:
    
            - name: NAMESPACE
    
              value: kubesphere-monitoring-federated
    
          resources:
    
            limits:
    
              cpu: 500m
    
              memory: 500Mi
    
            requests:
    
              cpu: 5m
    
              memory: 20Mi
    
          volumeMounts:
    
            - name: host-time
    
              readOnly: true
    
              mountPath: /etc/localtime
    
            - name: notification-manager-template
    
              mountPath: /etc/notification-manager/
    
          terminationMessagePath: /dev/termination-log
    
          terminationMessagePolicy: File
    
          imagePullPolicy: IfNotPresent
    
        - name: tenant
    
          image: >-
    
            registry.cn-beijing.aliyuncs.com/kubesphereio/notification-tenant-sidecar:v3.2.0
    
          ports:
    
            - name: tenant
    
              containerPort: 19094
    
              protocol: TCP
    
          resources: {}
    
          volumeMounts:
    
            - name: host-time
    
              readOnly: true
    
              mountPath: /etc/localtime
    
          terminationMessagePath: /dev/termination-log
    
          terminationMessagePolicy: File
    
          imagePullPolicy: IfNotPresent
    
      restartPolicy: Always
    
      terminationGracePeriodSeconds: 30
    
      dnsPolicy: ClusterFirst
    
      serviceAccountName: notification-manager-sa
    
      serviceAccount: notification-manager-sa
    
      securityContext: {}
    
      affinity: {}
    
      schedulerName: default-scheduler

    strategy:

    type: RollingUpdate
    
    rollingUpdate:
    
      maxUnavailable: 25%
    
      maxSurge: 25%

    revisionHistoryLimit: 10

    progressDeadlineSeconds: 600

    8 天 后

    找到问题了,直接修改deplpy的配置不启用,必须要修改NotificationManager的 CR ,且CR默认没有加上模版的配置,需手动添加一下。

    volumeMounts:

    - mountPath: /etc/notification-manager/

    name: notification-manager-template

    volumes:

    - configMap:

    defaultMode: 420

    name: notification-manager-template

    name: notification-manager-template