kind: Deployment
apiVersion: apps/v1
metadata:
  name: csi-memprovisioner
  namespace: kube-system
spec:
  selector:
    matchLabels:
      app: csi-memprovisioner
  replicas: 2
  template:
    metadata:
      labels:
        app: csi-memprovisioner
    spec:
      tolerations:
      - operator: "Exists"
      affinity:
        nodeAffinity:
          preferredDuringSchedulingIgnoredDuringExecution:
          - weight: 1
            preference:
              matchExpressions:
              - key: node-role.kubernetes.io/master
                operator: Exists
      priorityClassName: system-node-critical
      serviceAccount: csi-admin
      hostNetwork: true
      containers:
        - name: csi-provisioner
          image: registry.cn-hangzhou.aliyuncs.com/acs/csi-provisioner:v3.0.0-3f86569-aliyun
          args:
            - "--csi-address=$(ADDRESS)"
            - "--feature-gates=Topology=True"
            - "--volume-name-prefix=mem"
            - "--strict-topology=true"
            - "--timeout=150s"
            - "--leader-election=true"
            - "--retry-interval-start=500ms"
            - "--extra-create-metadata=true"
            - "--v=5"
          env:
            - name: ADDRESS
              value: /var/lib/kubelet/plugins/memplugin.csi.alibabacloud.com/csi.sock
          imagePullPolicy: "Always"
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/kubelet/plugins/memplugin.csi.alibabacloud.com
      volumes:
        - name: socket-dir
          hostPath:
            path: /var/lib/kubelet/plugins/memplugin.csi.alibabacloud.com
            type: DirectoryOrCreate
