zoukankan      html  css  js  c++  java
  • 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
  • 相关阅读:
    集合总结
    dagger2系列之Scope
    dagger2系列之依赖方式dependencies、包含方式(从属方式)SubComponent
    dagger2系列之生成类实例
    Dagger2系列之使用方法
    Handler系列之内存泄漏
    Handler系列之创建子线程Handler
    Handler系列之原理分析
    Handler系列之使用
    HTML标签
  • 原文地址:https://www.cnblogs.com/wuchangblog/p/14125491.html
Copyright © 2011-2022 走看看