apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-exporter
  labels:
    name: node-exporter
spec:
  selector:
    matchLabels:
      name: node-exporter
  template:
    metadata:
      labels:
        name: node-exporter
      annotations:
         prometheus.io/scrape: "true"
         prometheus.io/port: "9100"
    spec:
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      hostPID: true
      hostIPC: true
      hostNetwork: true
      containers:
        - name: node-exporter
          image: prom/node-exporter
          securityContext:
            privileged: true
          args:
            - --path.rootfs=/rootfs'
          ports:
            - containerPort: 9100
              protocol: TCP
          volumeMounts:
            - name: rootfs
              mountPath: /rootfs
      volumes:
        - name: rootfs
          hostPath:
            path: /