apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: csi-s3
  namespace: dlf
spec:
  selector:
    matchLabels:
      app: csi-s3
  template:
    metadata:
      labels:
        app: csi-s3
        app.kubernetes.io/name: dlf
    spec:
      containers:
      - args:
        - --v=5
        - --csi-address=/csi/csi.sock
        - --kubelet-registration-path=/var/lib/kubelet/plugins/csi-s3/csi.sock
        env:
        - name: KUBE_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        image: quay.io/k8scsi/csi-node-driver-registrar:v1.2.0
        imagePullPolicy: Always
        name: driver-registrar
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /csi
          name: socket-dir
        - mountPath: /registration
          name: registration-dir
      - args:
        - --v=5
        - --endpoint=$(CSI_ENDPOINT)
        - --nodeid=$(KUBE_NODE_NAME)
        env:
        - name: CSI_ENDPOINT
          value: unix:///csi/csi.sock
        - name: KUBE_NODE_NAME
          valueFrom:
            fieldRef:
              apiVersion: v1
              fieldPath: spec.nodeName
        - name: cheap
          value: "off"
        image: quay.io/datashim/csi-s3:latest-amd64
        imagePullPolicy: Always
        name: csi-s3
        securityContext:
          privileged: true
        volumeMounts:
        - mountPath: /csi
          name: socket-dir
        - mountPath: /var/lib/kubelet/pods
          mountPropagation: Bidirectional
          name: mountpoint-dir
        - mountPath: /dev
          name: dev-dir
      serviceAccountName: csi-s3
      volumes:
      - hostPath:
          path: /var/lib/kubelet/plugins/csi-s3
          type: DirectoryOrCreate
        name: socket-dir
      - hostPath:
          path: /var/lib/kubelet/pods
          type: DirectoryOrCreate
        name: mountpoint-dir
      - hostPath:
          path: /var/lib/kubelet/plugins_registry
          type: Directory
        name: registration-dir
      - hostPath:
          path: /dev
          type: Directory
        name: dev-dir
