
kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: csi-node
spec:
  selector:
    matchLabels:
      app: csi-node
  template:
    metadata:
      labels:
        app: csi-node
    spec:
      serviceAccount: csi-ozone
      containers:
      - name: driver-registrar
        image: quay.io/k8scsi/csi-node-driver-registrar:v1.0.2
        args:
        - --v=4
        - --csi-address=/var/lib/csi/csi.sock
        - --kubelet-registration-path=/var/lib/kubelet/plugins/org.apache.hadoop.ozone/csi.sock
        env:
        - name: KUBE_NODE_NAME
          valueFrom:
            fieldRef:
              fieldPath: spec.nodeName
        volumeMounts:
        - name: plugin-dir
          mountPath: /var/lib/csi
        - name: registration-dir
          mountPath: /registration/
      - name: csi-node
        image: flokkr/ozone
        securityContext:
          runAsUser: 0
          privileged: true
          capabilities:
            add:
            - SYS_ADMIN
          allowPrivilegeEscalation: true
        args:
        - ozone
        - csi
        envFrom:
        - configMapRef:
            name: ozone-config
        imagePullPolicy: IfNotPresent
        volumeMounts:
        - name: plugin-dir
          mountPath: /var/lib/csi
        - name: pods-mount-dir
          mountPath: /var/lib/kubelet/pods
          mountPropagation: Bidirectional
        - name: fuse-device
          mountPath: /dev/fuse
        - name: dbus
          mountPath: /var/run/dbus
        - name: systemd
          mountPath: /run/systemd
      volumes:
      - name: plugin-dir
        hostPath:
          path: /var/lib/kubelet/plugins/org.apache.hadoop.ozone
          type: DirectoryOrCreate
      - name: registration-dir
        hostPath:
          path: /var/lib/kubelet/plugins_registry/
          type: DirectoryOrCreate
      - name: pods-mount-dir
        hostPath:
          path: /var/lib/kubelet/pods
          type: Directory
      - name: fuse-device
        hostPath:
          path: /dev/fuse
      - name: dbus
        hostPath:
          path: /var/run/dbus
      - name: systemd
        hostPath:
          path: /run/systemd
