apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    app: local-provisioner
  name: local-provisioner
  namespace: ${OBJECT_NAMESPACE}
spec:
  selector:
    matchLabels:
      app: local-provisioner
  template:
    metadata:
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
      labels:
        app: local-provisioner
    spec:
      containers:
      - args:
        - lv-manager
        env:
        - name: MY_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: WATCH_NAMESPACE
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.namespace
        - name: POD_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: metadata.name
        image: ${CONTAINER_IMAGE}
        imagePullPolicy: IfNotPresent
        name: local-provisioner
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /mnt/local-storage
          mountPropagation: HostToContainer
          name: local-disks
        - mountPath: /dev
          mountPropagation: HostToContainer
          name: device-dir
        - mountPath: /etc/provisioner/config
          name: provisioner-config
          readOnly: true
      priorityClassName: openshift-user-critical
      serviceAccountName: local-storage-admin
      volumes:
      - hostPath:
          path: /mnt/local-storage
          type: ""
        name: local-disks
      - hostPath:
          path: /dev
          type: Directory
        name: device-dir
      - configMap:
          defaultMode: 420
          name: local-provisioner
        name: provisioner-config
