apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: lvm-exporter
  namespace: prometheus-operator
spec:
  selector:
    matchLabels:
      name: lvm-exporter
  template:
    metadata:
      labels:
        name: lvm-exporter
    spec:
      tolerations:
        # this toleration is to have the daemonset runnable on master nodes
        # remove it if your masters can't run pods
        - key: node-role.kubernetes.io/master
          operator: Exists
          effect: NoSchedule
      containers:
        - name: lvm-exporter
          image: sahil0071/lvm-exporter
          securityContext:
            privileged: true
            runAsGroup: 0
            runAsNonRoot: false
            runAsUser: 0
          ports:
            - containerPort: 9880
              hostPort: 9880
              name: metrics
              protocol: TCP
          terminationMessagePath: /dev/termination-log
          terminationMessagePolicy: File
          resources:
            limits:
              memory: 200Mi
            requests:
              cpu: 100m
              memory: 200Mi
          volumeMounts:
            - mountPath: /dev
              name: dev-dir
      terminationGracePeriodSeconds: 30
      volumes:
        - hostPath:
            path: /dev
            type: Directory
          name: dev-dir

