#TODO(#40): Force DaemonSet to not run on master.
kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: csi-gce-pd-node-win
spec:
  selector:
    matchLabels:
      app: gcp-compute-persistent-disk-csi-driver-win
  template:
    metadata:
      labels:
        app: gcp-compute-persistent-disk-csi-driver-win
    spec:
      # Host network must be used for interaction with Workload Identity in GKE
      # since it replaces GCE Metadata Server with GKE Metadata Server. Remove
      # this requirement when issue is resolved and before any exposure of
      # metrics ports. But hostNetwork is not working for Windows, might be an issue
      # when deploying on GKE Windows node.
      # hostNetwork: true
      priorityClassName: csi-gce-pd-node
      serviceAccountName: csi-gce-pd-node-sa-win
      nodeSelector:
        kubernetes.io/os: windows
      containers:
        - name: csi-driver-registrar
          image: gke.gcr.io/k8s-staging-csi/csi-node-driver-registrar-win
          args:
            - --v=5
            - --csi-address=unix://C:\\csi\\csi.sock
            - --kubelet-registration-path=C:\\var\\lib\\kubelet\\plugins\\pd.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
        - name: gce-pd-driver
          # Don't change base image without changing pdImagePlaceholder in
          # test/k8s-integration/main.go
          image: gke.gcr.io/gcp-compute-persistent-disk-csi-driver
          args:
            - "--v=5"
            - "--endpoint=unix:/csi/csi.sock"
          volumeMounts:
            - name: kubelet-dir
              mountPath: C:\var\lib\kubelet
              mountPropagation: "None"
            - name: plugin-dir
              mountPath: C:\csi
            - name: csi-proxy-disk-pipe
              mountPath: \\.\pipe\csi-proxy-disk-v1beta1
            - name: csi-proxy-volume-pipe
              mountPath: \\.\pipe\csi-proxy-volume-v1beta1
            - name: csi-proxy-filesystem-pipe
              mountPath: \\.\pipe\csi-proxy-filesystem-v1beta1
      volumes:
      - name: csi-proxy-disk-pipe
        hostPath:
          path: \\.\pipe\csi-proxy-disk-v1beta1
          type: ""
      - name: csi-proxy-volume-pipe
        hostPath:
          path: \\.\pipe\csi-proxy-volume-v1beta1
          type: ""
      - name: csi-proxy-filesystem-pipe
        hostPath:
          path: \\.\pipe\csi-proxy-filesystem-v1beta1
          type: ""
      - name: registration-dir
        hostPath:
          path: \var\lib\kubelet\plugins_registry
          type: Directory
      - name: kubelet-dir
        hostPath:
          path: \var\lib\kubelet
          type: Directory
      - name: plugin-dir
        hostPath:
          path: \var\lib\kubelet\plugins\pd.csi.storage.gke.io
          type: DirectoryOrCreate
