-- CLOUD-4752 node_memory_usage alert 관련  쿼리 수정
update metric_meta2 set
expr = 'sum by (xm_clst_id, xm_node_id)((node_memory_MemTotal_bytes{xm_entity_type="Node"}- (node_memory_MemFree_bytes{xm_entity_type="Node"} + node_memory_Cached_bytes{xm_entity_type="Node"} + node_memory_Buffers_bytes{xm_entity_type="Node"})) >= 0 or node_memory_MemTotal_bytes{xm_entity_type="Node"}- node_memory_MemFree_bytes{xm_entity_type="Node"}) / (sum by (xm_clst_id, xm_node_id) (imxc_kubernetes_node_resource_capacity_memory{{filter}})) * 100'
where id = 'node_memory_usage';

-- CLOUD-6474 node-exporter | GPMAXPROCS 세팅
-- Auto-generated SQL script #202211241543
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
          env:
          - name: GOMAXPROCS
            value: "1"
          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;