kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: csi-nodeplugin-nfsplugin
  namespace: openshift-manila-csi-driver
spec:
  selector:
    matchLabels:
      app: openstack-manila-csi
      component: nfs-nodeplugin
  updateStrategy:
    type: RollingUpdate
    rollingUpdate:
      maxUnavailable: 10%
  template:
    metadata:
      labels:
        app: openstack-manila-csi
        component: nfs-nodeplugin
    spec:
      hostNetwork: true
      dnsPolicy: ClusterFirstWithHostNet
      serviceAccount: manila-csi-driver-node-sa
      priorityClassName: system-node-critical
      tolerations:
        - operator: Exists
      containers:
        - name: csi-driver
          securityContext:
            privileged: true
          image: ${NFS_DRIVER_IMAGE}
          resources:
            requests:
              memory: 50Mi
              cpu: 10m
          args:
            - --v=${LOG_LEVEL}
            - "--nodeid=$(NODE_ID)"
            - "--endpoint=unix://plugin/csi.sock"
            - "--mount-permissions=0777"
          env:
            - name: NODE_ID
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          volumeMounts:
            - name: plugin-dir
              mountPath: /plugin
            - name: pods-mount-dir
              mountPath: /var/lib/kubelet/pods
              mountPropagation: Bidirectional
      volumes:
        - name: plugin-dir
          hostPath:
            path: /var/lib/kubelet/plugins/csi-nfsplugin
            type: DirectoryOrCreate
        - name: pods-mount-dir
          hostPath:
            path: /var/lib/kubelet/pods
            type: DirectoryOrCreate
