# This YAML file demonstrates how to deploy the external
# provisioner for use with the mock CSI driver. It
# depends on the RBAC definitions from rbac.yaml.
---
kind: Deployment
apiVersion: apps/v1
metadata:
  name: csi-provisioner
spec:
  replicas: 3
  selector:
    matchLabels:
      app: csi-provisioner
  template:
    metadata:
      labels:
        app: csi-provisioner
    spec:
      serviceAccount: csi-provisioner
      containers:
        - name: csi-provisioner
          image: gcr.io/k8s-staging-sig-storage/csi-provisioner:canary
          args:
            - "--csi-address=$(ADDRESS)"
            - "--leader-election"
            - "--http-endpoint=:8080"
          env:
            - name: ADDRESS
              value: /var/lib/csi/sockets/pluginproxy/mock.socket
          imagePullPolicy: "IfNotPresent"
          volumeMounts:
            - name: socket-dir
              mountPath: /var/lib/csi/sockets/pluginproxy/
          ports:
            - containerPort: 8080
              name: http-endpoint
              protocol: TCP
          livenessProbe:
            failureThreshold: 1
            httpGet:
              path: /healthz/leader-election
              port: http-endpoint
            initialDelaySeconds: 10
            timeoutSeconds: 10
            periodSeconds: 20
        - name: mock-driver
          image: quay.io/k8scsi/mock-driver:canary
          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:
