apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    app: diskmaker-manager
  name: diskmaker-manager
  namespace: ${OBJECT_NAMESPACE}
spec:
  selector:
    matchLabels:
      app: diskmaker-manager
  template:
    metadata:
      annotations:
        target.workload.openshift.io/management: '{"effect": "PreferredDuringScheduling"}'
      labels:
        app: diskmaker-manager
    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: diskmaker-manager
        securityContext:
          privileged: true
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        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
        - mountPath: /run/udev
          mountPropagation: HostToContainer
          name: run-udev
      - args:
        - --logtostderr=true
        - --secure-listen-address=0.0.0.0:9393
        - --upstream=http://127.0.0.1:8383/
        - --tls-cert-file=/etc/tls/private/tls.crt
        - --tls-private-key-file=/etc/tls/private/tls.key
        image: ${RBAC_PROXY_IMAGE}
        imagePullPolicy: IfNotPresent
        name: kube-rbac-proxy
        ports:
        - containerPort: 9393
          name: metrics
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /etc/tls/private
          name: metrics-serving-cert
      hostPID: true
      priorityClassName: ${PRIORITY_CLASS_NAME}
      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
      - hostPath:
          path: /run/udev
          type: ""
        name: run-udev
      - name: metrics-serving-cert
        secret:
          defaultMode: 420
          secretName: diskmaker-metric-serving-cert
  updateStrategy:
    rollingUpdate:
      maxSurge: 0
      maxUnavailable: 10%
    type: RollingUpdate
