apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-exporter
  namespace: monitoring
  labels:
    app: node-exporter
    kubernetes.io/cluster-service: "true"
    addonmanager.kubernetes.io/mode: Reconcile
spec:
  selector:
    matchLabels:
      app: node-exporter
  updateStrategy:
    type: OnDelete
  template:
    metadata:
      labels:
        app: node-exporter
    spec:
      containers:
        - name: prometheus-node-exporter
          image: "prom/node-exporter:v0.18.1"
          imagePullPolicy: "IfNotPresent"
          args:
            - --path.procfs=/host/proc
            - --path.sysfs=/host/sys
          ports:
            - name: metrics
              containerPort: 9100
              hostPort: 9100
          volumeMounts:
            - name: node-exporter-persistent-storage-proc
              mountPath: /host/proc
              readOnly:  true
            - name: node-exporter-persistent-storage-sys
              mountPath: /host/sys
              readOnly: true
      hostNetwork: true
      hostPID: true
      volumes:
      - name: node-exporter-persistent-storage-proc
        persistentVolumeClaim:
          claimName: node-exporter-pvc-proc
      - name: node-exporter-persistent-storage-sys
        persistentVolumeClaim:
          claimName: node-exporter-pvc-sys
