---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: node-exporter
spec:
  selector:
    matchLabels:
      app: node-exporter
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: node-exporter
    spec:
      containers:
        - name: node-exporter
          image: quay.io/prometheus/node-exporter:v1.3.0
          args:
            - --path.procfs=/host/proc
            - --path.rootfs=/rootfs
            - --path.sysfs=/host/sys
          securityContext:
            allowPrivilegeEscalation: true
            capabilities:
              drop:
                - CAP_MKNOD
                - CAP_NET_RAW
                - CAP_AUDIT_WRITE
            privileged: false
            readOnlyRootFilesystem: false
            runAsGroup: 0
            runAsUser: 0
          volumeMounts:
            - name: proc
              mountPath: /host/proc
              readOnly: true
            - name: sys
              mountPath: /host/sys
              readOnly: true
            - mountPath: /rootfs
              name: root
              readOnly: true
      hostNetwork: true
      volumes:
        - name: proc
          hostPath:
            path: /proc
            type: Directory
        - name: sys
          hostPath:
            path: /sys
            type: Directory
        - name: root
          hostPath:
            path: /
            type: Directory
