apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-exporter
  namespace: monitoring
  labels:
    app: node-exporter
spec:
  selector:
    matchLabels:
      app: node-exporter
  template:
    metadata:
      labels:
        app: node-exporter
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "9100"
    spec:
      hostPID: true
      hostIPC: true
      hostNetwork: true
      containers:
      - name: node-exporter
        image: prom/node-exporter:v0.18.1
        securityContext:
          privileged: true
        ports:
        - containerPort: 9100
          protocol: TCP
        resources:
          limits:
            cpu: 100m
            memory: 100Mi
          requests:
            cpu: 10m
            memory: 100Mi
        volumeMounts:
        - name: rootfs
          mountPath: /rootfs
        - name: pods
          mountPath: /pods
      volumes:
      - name: rootfs
        hostPath:
          path: /
      - name: pods
        hostPath:
          path: /var/lib/kubelet/pods
