#TODO: Force DaemonSet to not run on master.
#TODO: Make this run only on Windows nodes.
kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: gcp-filestore-csi-node
  namespace: gcp-filestore-csi-driver
spec:
  selector:
    matchLabels:
      app: gcp-filestore-csi-driver
  updateStrategy:
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: gcp-filestore-csi-driver
    spec:
      serviceAccount: gcp-filestore-csi-node-sa
      containers:
        - name: csi-driver-registrar
          imagePullPolicy: Always
          # image needs to be updated.
          image: gcr.io/<your project>/csi-node-driver-registrar:1809
          args:
            - "--v=5"
            - "--csi-address=unix:///csi/csi.sock"
            - "--kubelet-registration-path=C:\\var\\lib\\kubelet\\plugins\\filestore.csi.storage.gke.io\\csi.sock"
          env:
            - name: KUBE_NODE_NAME
              valueFrom:
                fieldRef:
                  fieldPath: spec.nodeName
          volumeMounts:
            - name: plugin-dir
              mountPath: /csi
            - name: registration-dir
              mountPath: /registration
      volumes:
        - name: registration-dir
          hostPath:
            path: C:\var\lib\kubelet\plugins_registry\
            type: Directory
        - name: plugin-dir
          hostPath:
            path: C:\var\lib\kubelet\plugins\filestore.csi.storage.gke.io\
            type: DirectoryOrCreate