kind: Deployment
apiVersion: apps/v1
metadata:
  name: hwameistor-local-disk-csi-controller
  namespace: hwameistor
spec:
  replicas: 1
  selector:
    matchLabels:
      app: hwameistor-local-disk-csi-controller
  template:
    metadata:
      labels:
        app: hwameistor-local-disk-csi-controller
    spec:
      priorityClassName: system-cluster-critical
      affinity:
#        podAffinity:
#          requiredDuringSchedulingIgnoredDuringExecution:
#          - labelSelector:
#              matchExpressions:
#              - key: app
#                operator: In
#                values:
#                - hwameistor-local-disk-manager
#            topologyKey: topology.disk.hwameistor.io/node
        nodeAffinity:
          requiredDuringSchedulingIgnoredDuringExecution:
            nodeSelectorTerms:
             - matchExpressions:
                - key: debugnode
                  operator: In
                  values:
                  - "true"
      serviceAccount: local-disk-manager
      containers:
        - name: provisioner
          image: k8s.gcr.io/sig-storage/csi-provisioner:v2.0.3
          imagePullPolicy: "IfNotPresent"
          args:
            - "--v=5"
            - "--csi-address=$(CSI_ADDRESS)"
            - "--leader-election=true"
            - "--feature-gates=Topology=true"
            - "--strict-topology"
            - "--extra-create-metadata=true"
          env:
            - name: CSI_ADDRESS
              value: /csi/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /csi
        - name: attacher
          image: k8s.gcr.io/sig-storage/csi-attacher:v3.0.1
          imagePullPolicy: IfNotPresent
          args:
            - "--v=5"
            - "--csi-address=$(CSI_ADDRESS)"
            - "--leader-election=true"
            - "--timeout=120s"
          env:
            - name: CSI_ADDRESS
              value: /csi/csi.sock
          volumeMounts:
            - name: socket-dir
              mountPath: /csi
      volumes:
        - name: socket-dir
          hostPath:
            path: /var/lib/kubelet/plugins/disk.hwameistor.io
            type: DirectoryOrCreate
