UPDATE public.metric_meta2 SET expr='sum by (xm_clst_id, xm_namespace, owner_name, xm_pod_id, xm_cont_name, xm_entity_type) ((container_memory_usage_bytes{xm_entity_type="Container", xm_cont_name!="POD"} + on (xm_clst_id, xm_namespace, xm_pod_id, xm_cont_name) group_left(owner_name) imxc_kubernetes_container_resource_limit_cpu{{filter}} * 0) / (((container_spec_memory_limit_bytes{xm_entity_type="Container", xm_cont_name!="POD"} + on (xm_clst_id, xm_namespace, xm_pod_id, xm_cont_name) group_left(owner_name) imxc_kubernetes_container_resource_limit_cpu{{filter}} * 0)) > 0) * 100) or sum by (xm_clst_id, xm_namespace, owner_name, xm_pod_id, xm_cont_name, xm_entity_type) ((container_memory_usage_bytes{xm_entity_type="Container", xm_cont_name!="POD"}  + on (xm_clst_id, xm_namespace, xm_pod_id, xm_cont_name) group_left(owner_name)  imxc_kubernetes_container_resource_limit_cpu{{filter}} * 0)  / 1024 / 1024 / 1024 *100)' WHERE id = 'container_memory_usage_by_workload';

UPDATE public.agent_install_file_info SET yaml = '---
apiVersion: v1
kind: List
items:
- apiVersion: apps/v1
  kind: Deployment
  metadata:
    name: cloudmoa-trace-agent
    namespace: $CLOUDMOA_NAMESPACE
    labels:
      app: cloudmoa-trace-agent
  spec:
    selector:
      matchLabels:
        app: cloudmoa-trace-agent
    replicas: 1
    strategy:
      type: Recreate
    template:
      metadata:
        labels:
          app: cloudmoa-trace-agent
      spec:
        securityContext:
          runAsNonRoot: true
          runAsUser: 65534
        containers:
          - image: $DOCKER_REGISTRY_URL/trace-agent:$IMAGE_TAG
            name: cloudmoa-trace-agent
            resources:
              requests:
                cpu: 100m
                memory: 50Mi
              limits:
                cpu: 200m
                memory: 100Mi
            ports:
              - containerPort: 5775
                protocol: UDP
              - containerPort: 6831
                protocol: UDP
              - containerPort: 6832
                protocol: UDP
              - containerPort: 5778
                protocol: TCP
            env:
              - name: LOG_LEVEL
                value: "INFO"
              - name: CLUSTER_ID
                value: $CLOUDMOA_CLUSTER_ID
              - name: DATAGATE
                value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT
- apiVersion: v1
  kind: Service
  metadata:
    name: cloudmoa-trace-agent
    namespace: $CLOUDMOA_NAMESPACE
    labels:
      app: cloudmoa-trace-agent
  spec:
    ports:
      - name: agent-zipkin-thrift
        port: 5775
        protocol: UDP
        targetPort: 5775
      - name: agent-compact
        port: 6831
        protocol: UDP
        targetPort: 6831
      - name: agent-binary
        port: 6832
        protocol: UDP
        targetPort: 6832
      - name: agent-configs
        port: 5778
        protocol: TCP
        targetPort: 5778
    selector:
      app: cloudmoa-trace-agent
    type: ClusterIP' WHERE id = 7;

UPDATE public.agent_install_file_info SET yaml = '---
apiVersion: v1
kind: Service
metadata:
  annotations:
    prometheus.io/scrape: ''true''
  labels:
    app: cloudmoa-node-exporter
    name: cloudmoa-node-exporter
  name: cloudmoa-node-exporter
  namespace: $CLOUDMOA_NAMESPACE
spec:
  clusterIP: None
  ports:
    - name: scrape
      port: 9110
      protocol: TCP
  selector:
    app: cloudmoa-node-exporter
  type: ClusterIP
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: cloudmoa-node-exporter
  namespace: $CLOUDMOA_NAMESPACE
spec:
  selector:
    matchLabels:
      app: cloudmoa-node-exporter
  template:
    metadata:
      labels:
        app: cloudmoa-node-exporter
      name: cloudmoa-node-exporter
    spec:
      tolerations:
        - effect: NoSchedule
          operator: Exists
        - effect: NoExecute
          operator: Exists
      containers:
        - image: $DOCKER_REGISTRY_URL/node-exporter
          name: cloudmoa-node-exporter
          ports:
            - containerPort: 9110
              hostPort: 9110
              name: scrape
          args:
            - --path.procfs=/host/proc
            - --path.sysfs=/host/sys
            - --path.rootfs=/host/root
            - --collector.filesystem.ignored-mount-points=^/(dev|proc|sys|run|var/lib/docker/.+|var/lib/kubelet/pods/.+)($|/)
            - --collector.tcpstat
            - --web.listen-address=:9110
          # --log.level=debug
          resources:
            limits:
              cpu: 250m
              memory: 180Mi
            requests:
              cpu: 102m
              memory: 180Mi
          volumeMounts:
            - mountPath: /host/proc
              name: proc
              readOnly: false
            - mountPath: /host/sys
              name: sys
              readOnly: false
            - mountPath: /host/root
              mountPropagation: HostToContainer
              name: root
              readOnly: true
      hostNetwork: true
      hostPID: true
      securityContext:
        runAsNonRoot: true
        runAsUser: 65534
      volumes:
        - hostPath:
            path: /proc
          name: proc
        - hostPath:
            path: /sys
          name: sys
        - hostPath:
            path: /
          name: root
' WHERE id = 4;

UPDATE public.agent_install_file_info SET yaml = '---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: cloudmoa-cluster-role
rules:
  - nonResourceURLs:
      - "*"
    verbs:
      - get
  - apiGroups:
      - metrics.k8s.io
    resources:
      - pods
      - nodes
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - ""
    resources:
      - pods
    verbs:
      - get
      - list
      - watch
      - update
  - apiGroups:
      - ""
    resources:
      - services
    verbs:
      - get
      - list
      - watch
      - update
  - apiGroups:
      - ""
    resources:
      - nodes/stats
      - endpoints
      - namespaces
      - events
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - apps
    resources:
      - daemonsets
      - deployments
      - deployments/scale
      - replicasets
      - replicasets/scale
      - statefulsets
      - statefulsets/scale
    verbs:
      - get
      - list
      - watch
  - apiGroups:
      - batch
    resources:
      - jobs
    verbs:
      - get
      - list
      - watch
      - update
  - apiGroups:
      - batch
    resources:
      - cronjobs
    verbs:
      - get
      - list
      - update
  - apiGroups:
      - storage.j8s.io
    resources:
      - storageclasses
    verbs:
      - get
      - list
  - apiGroups:
      - networking.k8s.io
    resources:
      - ingresses
    verbs:
      - get
      - list
  - apiGroups:
      - extensions
    resources:
      - ingresses
    verbs:
      - get
      - list
  - apiGroups:
      - policy
    resources:
      - podsecuritypolicies
    verbs:
      - use
    resourceNames:
      - imxc-ps
  - apiGroups:
      - certificates.k8s.io
    resourceNames:
      - kubernetes.io/kube-apiserver-client-kubelet
    resources:
      - signers
    verbs:
      - approve
  - apiGroups:
      - certificates.k8s.io
    resourceNames:
      - kubernetes.io/kubelet-serving
    resources:
      - signers
    verbs:
      - approve
  - apiGroups:
      - ""
    resources:
      - nodes
    verbs:
      - get
      - list
      - watch
      - proxy
  - apiGroups:
      - ""
    resources:
      - nodes/log
      - nodes/metrics
      - nodes/proxy
      - nodes/spec
      - nodes/stats
    verbs:
      - ''*''
  - apiGroups:
      - ''*''
    resources:
      - ''*''
    verbs:
      - get
      - list
      - watch
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: cloudmoa-restricted-rb
  namespace: $CLOUDMOA_NAMESPACE
subjects:
  - kind: ServiceAccount
    name: default
    namespace: $CLOUDMOA_NAMESPACE
roleRef:
  kind: ClusterRole
  name: cloudmoa-cluster-role
  apiGroup: rbac.authorization.k8s.io
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: cloudmoa-psp
  namespace: $CLOUDMOA_NAMESPACE
spec:
  privileged: true
  seLinux:
    rule: RunAsAny
  supplementalGroups:
    rule: RunAsAny
  runAsUser:
    rule: RunAsAny
  fsGroup:
    rule: RunAsAny
  hostPorts:
    - max: 65535
      min: 0
  hostNetwork: true
  hostPID: true
  volumes:
    - configMap
    - secret
    - emptyDir
    - hostPath
    - projected
    - downwardAPI
    - persistentVolumeClaim
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: cloudmoa-topology-agent
  namespace: $CLOUDMOA_NAMESPACE
  labels:
    app: cloudmoa-topology-agent
spec:
  selector:
    matchLabels:
      app: cloudmoa-topology-agent
  template:
    metadata:
      labels:
        app: cloudmoa-topology-agent
    spec:
      hostNetwork: true
      hostPID: true
      tolerations:
      - effect: NoSchedule
        operator: Exists
      - effect: NoExecute
        operator: Exists
      containers:
      - name: cloudmoa-topology-agent
        image: $DOCKER_REGISTRY_URL/topology-agent:$IMAGE_TAG
        imagePullPolicy: Always
        resources:
          requests:
            cpu: 200m
            memory: 512Mi
          limits:
            cpu: 500m
            memory: 600Mi
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /host/usr/bin
          name: bin-volume
        - mountPath: /var/run/docker.sock
          name: docker-volume
        - mountPath: /host/proc
          name: proc-volume
        - mountPath: /root
          name: root-volume
        - mountPath: /log
          name: log-volume
        env:
          - name: DATAGATE
            value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT
          - name: CLUSTER_ID
            value: $CLOUDMOA_CLUSTER_ID
          - name: ROOT_DIRECTORY
            value: /root
          - name: NODE_NAME
            valueFrom:
              fieldRef:
                apiVersion: v1
                fieldPath: spec.nodeName
          - name: LOG_LEVEL
            value: "INFO"

      volumes:
      - name: bin-volume
        hostPath:
          path: /usr/bin
          type: Directory
      - name: docker-volume
        hostPath:
          path: /var/run/docker.sock
      - name: proc-volume
        hostPath:
          path: /proc
      - name: root-volume
        hostPath:
          path: /
      - name: log-volume
        hostPath:
          path: /home' WHERE id = 2;

UPDATE public.agent_install_file_info SET yaml = '---
apiVersion: v1
kind: ConfigMap
metadata:
  name: cloudmoa-metric-agent-config
  namespace: $CLOUDMOA_NAMESPACE
data:
  scaling.rules: |
    groups:
    - name: scaleup
      rules :
      - alert : ScaleUpRule
        expr: job:webapp_config_open_sessions_current_count:sum > 15
        annotations:
          summary: "Scale up when current sessions is greater than 15"
          description: "Firing when total sessions active greater than 15"
  metric-agent.yml: |
    global:
      scrape_interval:     15s

    scrape_configs:
      - job_name: ''kubernetes-kubelet''
        scheme: https
        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
        kubernetes_sd_configs:
        - role: node
        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/${1}/proxy/metrics
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: xm_node_id
        - target_label: xm_clst_id
          replacement: ''$CLOUDMOA_CLUSTER_ID''
        - target_label: xm_entity_type
          replacement: ''Node''
        metric_relabel_configs:
        - source_labels: [ __name__ ]
          regex: (kubelet_running_pod_count)
          action: keep

      - job_name: ''kubernetes-node-exporter''
        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
        kubernetes_sd_configs:
        - role: node

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - source_labels: [__meta_kubernetes_role]
          action: replace
          target_label: kubernetes_role
        - source_labels: [__address__]
          regex: ''(.*):10250''
          replacement: ''${1}:9110''
          target_label: __address__
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: __instance__
          # set "name" value to "job"
        - source_labels: [job]
          regex: ''kubernetes-(.*)''
          replacement: ''${1}''
          target_label: name
        - target_label: xm_clst_id
          replacement: ''$CLOUDMOA_CLUSTER_ID''
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: xm_node_id
        - target_label: xm_entity_type
          replacement: ''Node''
        - source_labels: [__meta_kubernetes_namespace]
          separator: ;
          regex: (.*)
          target_label: xm_namespace
          replacement: $1
          action: replace
        metric_relabel_configs:
        - source_labels: [ __name__ ]
          regex: (node_boot_time_seconds|node_context_switches_total|node_cpu_frequency_max_hertz|node_cpu_package_throttles_total|node_cpu_seconds_total|node_disk_io_time_seconds_total|node_disk_read_bytes_total|node_disk_read_time_seconds_total|node_disk_reads_completed_total|node_disk_write_time_seconds_total|node_disk_writes_completed_total|node_disk_written_bytes_total|node_filefd_allocated|node_filesystem_avail_bytes|node_filesystem_free_bytes|node_filesystem_size_bytes|node_load1|node_load15|node_load5|node_memory_Active_bytes|node_memory_Buffers_bytes|node_memory_Cached_bytes|node_memory_MemAvailable_bytes|node_memory_MemFree_bytes|node_memory_MemTotal_bytes|node_memory_SwapCached_bytes|node_memory_SwapFree_bytes|node_memory_SwapTotal_bytes|node_network_receive_bytes_total|node_network_receive_bytes_total|node_network_transmit_bytes_total|node_network_transmit_bytes_total)
          action: keep

      - job_name: ''kubernetes-cadvisor''
        scheme: https
        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
          insecure_skip_verify: true
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token

        kubernetes_sd_configs:
        - role: node
        metrics_path: /metrics/cadvisor

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: xm_clst_id
          replacement: ''$CLOUDMOA_CLUSTER_ID''
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: xm_node_id
        - target_label: xm_entity_type
          replacement: ''Container''

        metric_relabel_configs:
        - source_labels: [namespace]
          target_label: xm_namespace
        - source_labels: [pod]
          target_label: xm_pod_id
        - source_labels: [container]
          target_label: xm_cont_name
        - source_labels: [id]
          target_label: xm_cont_id
        - source_labels: [container]
          regex: (.+)
          action: keep
        - source_labels: [ __name__ ]
          regex: (container_cpu_cfs_throttled_seconds_total|container_cpu_system_seconds_total|container_cpu_usage_seconds_total|container_cpu_user_seconds_total|container_fs_limit_bytes|container_fs_reads_bytes_total|container_fs_usage_bytes|container_fs_writes_bytes_total|container_last_seen|container_memory_cache|container_memory_max_usage_bytes|container_memory_swap|container_memory_usage_bytes|container_memory_working_set_bytes|container_network_receive_bytes_total|container_network_transmit_bytes_total|container_spec_memory_limit_bytes)
          action: keep
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cloudmoa-metric-agent
  namespace: $CLOUDMOA_NAMESPACE
  labels:
    app: cloudmoa-metric-agent
spec:
  selector:
    matchLabels:
      app: cloudmoa-metric-agent
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: cloudmoa-metric-agent
    spec:
      containers:
        - name: cloudmoa-metric-agent
          image: $DOCKER_REGISTRY_URL/metric-agent:$IMAGE_TAG
          args:
            - --config.file=/etc/metric-agent/metric-agent.yml
          resources:
            requests:
              cpu: 100m
              memory: 512Mi
            limits:
              cpu: 300m
              memory: 1000Mi
          volumeMounts:
            - mountPath: /etc/metric-agent/
              name: config-volume
          env:
            - name: LOG_LEVEL
              value: "INFO"
            - name: LOG_MAXAGE
              value: "1"
            - name: CLUSTER_ID
              value: $CLOUDMOA_CLUSTER_ID
            - name: DATAGATE
              value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT
            - name: STORAGE_TYPE
              value: datagate
      restartPolicy: Always
      volumes:
        - name: config-volume
          configMap:
            name: cloudmoa-metric-agent-config
' WHERE id = 6;

UPDATE public.agent_install_file_info SET yaml = '---
apiVersion: v1
kind: ConfigMap
metadata:
  name: cloudmoa-metric-agent-config
  namespace: $CLOUDMOA_NAMESPACE
data:
  scaling.rules: |
    groups:
    - name: scaleup
      rules :
      - alert : ScaleUpRule
        expr: job:webapp_config_open_sessions_current_count:sum > 15
        annotations:
          summary: "Scale up when current sessions is greater than 15"
          description: "Firing when total sessions active greater than 15"
  metric-agent.yml: |
    global:
      scrape_interval:     15s

    scrape_configs:
      - job_name: ''kubernetes-kubelet''
        scheme: https
        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
        kubernetes_sd_configs:
        - role: node
        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: __address__
          replacement: kubernetes.default.svc:443
        - source_labels: [__meta_kubernetes_node_name]
          regex: (.+)
          target_label: __metrics_path__
          replacement: /api/v1/nodes/${1}/proxy/metrics
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: xm_node_id
        - target_label: xm_clst_id
          replacement: ''$CLOUDMOA_CLUSTER_ID''
        - target_label: xm_entity_type
          replacement: ''Node''

        metric_relabel_configs:
        - source_labels: [ __name__ ]
          regex: (kubelet_running_pod_count)
          action: keep

      - job_name: ''kubernetes-node-exporter''
        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
        kubernetes_sd_configs:
        - role: node

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - source_labels: [__meta_kubernetes_role]
          action: replace
          target_label: kubernetes_role
        - source_labels: [__address__]
          regex: ''(.*):10250''
          replacement: ''${1}:9110''
          target_label: __address__
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: __instance__
          # set "name" value to "job"
        - source_labels: [job]
          regex: ''kubernetes-(.*)''
          replacement: ''${1}''
          target_label: name
        - target_label: xm_clst_id
          replacement: ''$CLOUDMOA_CLUSTER_ID''
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: xm_node_id
        - target_label: xm_entity_type
          replacement: ''Node''
        - source_labels: [__meta_kubernetes_namespace]
          separator: ;
          regex: (.*)
          target_label: xm_namespace
          replacement: $1
          action: replace
        metric_relabel_configs:
        - source_labels: [ __name__ ]
          regex: (node_boot_time_seconds|node_context_switches_total|node_cpu_frequency_max_hertz|node_cpu_package_throttles_total|node_cpu_seconds_total|node_disk_io_time_seconds_total|node_disk_read_bytes_total|node_disk_read_time_seconds_total|node_disk_reads_completed_total|node_disk_write_time_seconds_total|node_disk_writes_completed_total|node_disk_written_bytes_total|node_filefd_allocated|node_filesystem_avail_bytes|node_filesystem_free_bytes|node_filesystem_size_bytes|node_load1|node_load15|node_load5|node_memory_Active_bytes|node_memory_Buffers_bytes|node_memory_Cached_bytes|node_memory_MemAvailable_bytes|node_memory_MemFree_bytes|node_memory_MemTotal_bytes|node_memory_SwapCached_bytes|node_memory_SwapFree_bytes|node_memory_SwapTotal_bytes|node_network_receive_bytes_total|node_network_receive_bytes_total|node_network_transmit_bytes_total|node_network_transmit_bytes_total)
          action: keep


      - job_name: ''kubernetes-cadvisor''
        scheme: https
        tls_config:
          ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
          insecure_skip_verify: true
        bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
        kubernetes_sd_configs:
        - role: node
        metrics_path: /metrics/cadvisor

        relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - target_label: xm_clst_id
          replacement: ''$CLOUDMOA_CLUSTER_ID''
        - source_labels: [__meta_kubernetes_node_label_kubernetes_io_hostname]
          target_label: xm_node_id
        - target_label: xm_entity_type
          replacement: ''Container''

        metric_relabel_configs:
        - source_labels: [namespace]
          target_label: xm_namespace
        - source_labels: [pod_name]
          target_label: xm_pod_id
        - source_labels: [container_name]
          target_label: xm_cont_name
        - source_labels: [id]
          target_label: xm_cont_id
        - source_labels: [container_name]
          regex: (.+)
          action: keep
        - source_labels: [ __name__ ]
          regex: (container_cpu_cfs_throttled_seconds_total|container_cpu_system_seconds_total|container_cpu_usage_seconds_total|container_cpu_user_seconds_total|container_fs_limit_bytes|container_fs_reads_bytes_total|container_fs_usage_bytes|container_fs_writes_bytes_total|container_last_seen|container_memory_cache|container_memory_max_usage_bytes|container_memory_swap|container_memory_usage_bytes|container_memory_working_set_bytes|container_network_receive_bytes_total|container_network_transmit_bytes_total|container_spec_memory_limit_bytes)
          action: keep
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: cloudmoa-metric-agent
  namespace: $CLOUDMOA_NAMESPACE
  labels:
    app: cloudmoa-metric-agent
spec:
  selector:
    matchLabels:
      app: cloudmoa-metric-agent
  replicas: 1
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: cloudmoa-metric-agent
    spec:
      containers:
        - name: cloudmoa-metric-agent
          image: $DOCKER_REGISTRY_URL/metric-agent:$IMAGE_TAG
          args:
            - --config.file=/etc/metric-agent/metric-agent.yml
          resources:
            requests:
              cpu: 100m
              memory: 512Mi
            limits:
              cpu: 300m
              memory: 1000Mi
          volumeMounts:
            - mountPath: /etc/metric-agent/
              name: config-volume
          env:
            - name: LOG_LEVEL
              value: "INFO"
            - name: CLUSTER_ID
              value: $CLOUDMOA_CLUSTER_ID
            - name: DATAGATE
              value: $COLLTION_SERVER_DATAGATE_IP:$COLLTION_SERVER_DATAGATE_PORT
            - name: STORAGE_TYPE
              value: datagate
      restartPolicy: Always
      volumes:
        - name: config-volume
          configMap:
            name: cloudmoa-metric-agent-config
' WHERE id = 3;