apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: $APP_INSTANCE_NAME-node-exporter
  labels:
    k8s-app: node-exporter
    app.kubernetes.io/name: $APP_INSTANCE_NAME
    app.kubernetes.io/component: node-exporter
spec:
  updateStrategy:
    type: OnDelete
  selector:
    matchLabels:
      k8s-app: node-exporter
  template:
    metadata:
      labels:
        k8s-app: node-exporter
    spec:
      serviceAccountName: $NODE_EXPORTER_SERVICE_ACCOUNT
      containers:
        - name: prometheus-node-exporter
          image: $IMAGE_NODE_EXPORTER
          imagePullPolicy: Always
          args:
            - --path.procfs=/host/proc
            - --path.sysfs=/host/sys
          ports:
            - name: metrics
              containerPort: 9100
              hostPort: 9100
          volumeMounts:
            - name: proc
              mountPath: /host/proc
              readOnly:  true
            - name: sys
              mountPath: /host/sys
              readOnly: true
          resources:
            limits:
              cpu: 10m
              memory: 50Mi
            requests:
              cpu: 10m
              memory: 50Mi
      hostNetwork: true
      hostPID: true
      volumes:
        - name: proc
          hostPath:
            path: /proc
        - name: sys
          hostPath:
            path: /sys
