# This YAML file demonstrates how to deploy the external
# resizer for use with the mock CSI driver. It
# depends on the RBAC definitions from rbac.yaml.

kind: Deployment
apiVersion: apps/v1
metadata:
  name: csi-resizer
spec:
  replicas: 1
  selector:
    matchLabels:
      external-resizer: mock-driver
  template:
    metadata:
      labels:
        external-resizer: mock-driver
    spec:
      serviceAccount: csi-resizer
      containers:
        - name: csi-resizer
          image: quay.io/k8scsi/csi-resizer:canary
          args:
            - "--v=5"
            - "--csi-address=$(ADDRESS)"
            - "--leader-election"
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/mock.socket
          imagePullPolicy: "IfNotPresent"
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/

        - name: mock-driver
          image: quay.io/k8scsi/mock-driver:canary
          imagePullPolicy: "IfNotPresent"
          env:
            - name: CSI_ENDPOINT
              value: /var/lib/csi/sockets/pluginproxy/mock.socket
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/

      volumes:
        - name: socket-dir
          emptyDir:
