• prometheus之四:node-exporter


    一、下载node-exporter.yaml文件

    apiVersion: apps/v1
    kind: DaemonSet
    metadata:
      name: node-exporter-daemonset
      namespace: kube-ops
    spec:
      selector:
        matchLabels:
          app: prometheus
      template:
        metadata:
          labels:
            app: prometheus
        spec:
          hostNetwork: true
          containers:
          - name: node-exporter
            image: prom/node-exporter
            ports:
              - containerPort: 9100
            imagePullPolicy: IfNotPresent
            command:
            - /bin/node_exporter
            - --path.procfs
            - /host/proc
            - --path.sysfs
            - /host/sys
            - --collector.filesystem.ignored-mount-points
            - ^/(sys|proc|dev|host|etc)($|/)
            volumeMounts:
            - name: proc
              mountPath: /host/proc
            - name: sys
              mountPath: /host/sys
            - name: root
              mountPath: /rootfs
          volumes:
          - name: proc
            hostPath:
              path: /proc
          - name: sys
            hostPath:
              path: /sys
          - name: root
            hostPath:
              path: /
    

    二、配置相应的configmap.yaml

    apiVersion: v1
    kind: ConfigMap
    metadata:
      name: prometheus-config
      namespace: kube-ops
    data:
      prometheus.yml: |
        global:
          scrape_interval: 15s
          scrape_timeout: 15s
        scrape_configs:
        - job_name: 'prometheus'
          static_configs:
          - targets: ['localhost:9090']
    
        - job_name: 'k8s-nodes'
          static_configs:
          - targets:
             - 192.168.48.120:9100
             - 192.168.48.200:9100
  • 相关阅读:
    ORACLE表空间管理维护
    oracle表分区详解
    Jquery
    B
    A
    E
    字符串排成字典序,字符串数组
    命令,快捷键,配置
    第一个java程序
    A
  • 原文地址:https://www.cnblogs.com/wuchangblog/p/14125491.html
Copyright © 2020-2023  润新知