apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: prometheus-node-exporter
  namespace: monitoring
  labels:
    app: node-exporter
spec:
  selector:
    matchLabels:
      app: node-exporter
  template:
    metadata:
      name: prometheus-node-exporter
      labels:
        app: node-exporter
    spec:
      containers:
      - image: prom/node-exporter
        name: prometheus-node-exporter
        ports:
        - name: node-exporter
          containerPort: 9101
          hostPort: 9101
        resources:
          requests:
            cpu: "0.4"
            memory: 200M
          limits:
            cpu: "0.4"
            memory: 200M
        command:
        - /bin/node_exporter
        - --web.listen-address
        - ':9101'
        - --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
      tolerations:
      - key: "node-role.kubernetes.io/master"
        operator: "Exists"
        effect: "NoSchedule"
      volumes:
      - name: proc
        hostPath:
          path: /proc
      - name: sys
        hostPath:
          path: /sys
      - name: root
        hostPath:
          path: /
      hostNetwork: true
      hostPID: true