kind: DaemonSet
apiVersion: apps/v1
metadata:
  name: csi-secrets-store-windows
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: csi-secrets-store
  template:
    metadata:
      labels:
        app: csi-secrets-store
      annotations:
        kubectl.kubernetes.io/default-logs-container: secrets-store
    spec:
      serviceAccountName: secrets-store-csi-driver
      containers:
        - name: node-driver-registrar
          image: k8s.gcr.io/sig-storage/csi-node-driver-registrar:v2.3.0
          args:
            - --v=5
            - "--csi-address=unix://C:\\csi\\csi.sock"
            - "--kubelet-registration-path=C:\\var\\lib\\kubelet\\plugins\\csi-secrets-store\\csi.sock"
          livenessProbe:
            exec:
              command:
              - /csi-node-driver-registrar.exe
              - --kubelet-registration-path=C:\var\lib\kubelet\plugins\csi-secrets-store\csi.sock
              - --mode=kubelet-registration-probe
            initialDelaySeconds: 3
          env:
            - name: KUBE_NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
          imagePullPolicy: IfNotPresent
          volumeMounts:
            - name: plugin-dir
              mountPath: C:\csi
            - name: registration-dir
              mountPath: C:\registration
          resources:
            limits:
              cpu: 200m
              memory: 200Mi
            requests:
              cpu: 10m
              memory: 20Mi
        - name: secrets-store
          image: k8s.gcr.io/csi-secrets-store/driver:v0.2.0
          args:
            - "--endpoint=$(CSI_ENDPOINT)"
            - "--nodeid=$(KUBE_NODE_NAME)"
            - "--provider-volume=C:\\k\\secrets-store-csi-providers"
            - "--metrics-addr=:8095"
            - "--enable-secret-rotation=false"
            - "--rotation-poll-interval=2m"
            - "--filtered-watch-secret=true"
            - "--provider-health-check=false"
            - "--provider-health-check-interval=2m"
          env:
            - name: CSI_ENDPOINT
              value: unix://C:\\csi\\csi.sock
            - name: KUBE_NODE_NAME
              valueFrom:
                fieldRef:
                  apiVersion: v1
                  fieldPath: spec.nodeName
          imagePullPolicy: IfNotPresent
          ports:
            - containerPort: 9808
              name: healthz
              protocol: TCP
            - containerPort: 8095
              name: metrics
              protocol: TCP
          livenessProbe:
              failureThreshold: 5
              httpGet:
                path: /healthz
                port: healthz
              initialDelaySeconds: 30
              timeoutSeconds: 10
              periodSeconds: 15
          resources:
            limits:
              cpu: 400m
              memory: 400Mi
            requests:
              cpu: 50m
              memory: 100Mi
          volumeMounts:
            - name: plugin-dir
              mountPath: C:\csi
            - name: mountpoint-dir
              mountPath: "C:\\var\\lib\\kubelet\\pods"
            - name: providers-dir
              mountPath: C:\k\secrets-store-csi-providers
        - name: liveness-probe
          image: k8s.gcr.io/sig-storage/livenessprobe:v2.3.0
          imagePullPolicy: IfNotPresent
          args:
          - "--csi-address=unix://C:\\csi\\csi.sock"
          - --probe-timeout=3s
          - --http-endpoint=0.0.0.0:9808
          - -v=2
          volumeMounts:
            - name: plugin-dir
              mountPath: C:\csi
          resources:
            limits:
              cpu: 200m
              memory: 200Mi
            requests:
              cpu: 10m
              memory: 20Mi
      volumes:
        - name: mountpoint-dir
          hostPath:
            path: C:\var\lib\kubelet\pods\
            type: DirectoryOrCreate
        - name: registration-dir
          hostPath:
            path: C:\var\lib\kubelet\plugins_registry\
            type: Directory
        - name: plugin-dir
          hostPath:
            path: C:\var\lib\kubelet\plugins\csi-secrets-store\
            type: DirectoryOrCreate
        - name: providers-dir
          hostPath:
            path: C:\k\secrets-store-csi-providers\
            type: DirectoryOrCreate
      nodeSelector:
        kubernetes.io/os: windows
