kind: StatefulSet
apiVersion: apps/v1
metadata:
  name: vsphere-csi-provisioner
  namespace: kube-system
spec:
  serviceName: vsphere-csi-provisioner
  replicas: 1
  selector:
    matchLabels:
      app: vsphere-csi-provisioner
  template:
    metadata:
      labels:
        app: vsphere-csi-provisioner
    spec:
      nodeSelector:
        node-role.kubernetes.io/master: ""
      tolerations:
      - key: node.cloudprovider.kubernetes.io/uninitialized
        value: "true"
        effect: NoSchedule
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      affinity:
        podAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
              - key: app
                operator: In
                values:
                - vsphere-csi-controller
            topologyKey: kubernetes.io/hostname
      serviceAccountName: vsphere-csi-provisioner
      containers:
        - name: csi-provisioner
          image: quay.io/k8scsi/csi-provisioner:v1.1.0
          args:
            - -v=5
            - "--csi-address=$(ADDRESS)"
            - "--feature-gates=Topology=true"
          env:
            - name: ADDRESS
              value: /csi/csi.sock
          volumeMounts:
            - mountPath: /csi
              name: socket-dir
      volumes:
        - name: socket-dir
          hostPath:
            path: /var/lib/csi/sockets/pluginproxy/vsphere.csi.vmware.com
            type: DirectoryOrCreate
