---
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: numainfo-exporter
  labels:
    app: numainfo-exporter
spec:
  selector:
    matchLabels:
      name: numainfo-exporter
  template:
    metadata:
      labels:
        name: numainfo-exporter
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "19091"
    spec:
      serviceAccountName: numainfo-exporter
      nodeSelector:
        node-role.kubernetes.io/worker: ""
      containers:
      - name: collector
        ports:
        - containerPort: 19091
          protocol: "TCP"
          name: "metrics"
        image: quay.io/fromani/numainfo_exporter:devel
        imagePullPolicy: Always
        command:
        - numainfo_exporter
        - -v=5
        - -L=:19091
        - -K=/kubestate
        volumeMounts:
        - name: kube-state
          mountPath: /kubestate
          readOnly: true
        - name: sys-fs
          mountPath: /sys
          readOnly: true
        env:
        - name: NUMAINFO_NODENAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
      volumes:
      - name: kube-state
        hostPath:
          path: /var/lib/kubelet
      - name: sys-fs
        hostPath:
          path: /sys
