---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: e2e-minio-deployment-
  namespace: e2e
spec:
  template:
    metadata:
      name: e2e
      labels:
        app: minio-e2e

    spec:
      serviceAccountName: e2e
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/cstor-csi-e2e:ci
        imagePullPolicy: IfNotPresent

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            value: default

            # storage class to deploy wordpress
          - name: PROVIDER_STORAGE_CLASS
            value: 'openebs-cstor-csi'
     
            # Application PVC name for minio deployment
          - name: APP_PVC
            value: minio-pv-claim

            # Application label
          - name: APP_LABEL
            value: 'name=minio'

            # Application namespace
          - name: APP_NAMESPACE
            value: app-minio-ns 

            # Use 'deprovision' for app-clean up
          - name: ACTION
            value: 'provision'

           # PV capacity for minio  
          - name: CAPACITY
            value: 5Gi

           # Number of minio deployments to be created
          - name: DEPLOY_COUNT
            value: '4'
           
           # Access mode for pvc
           # For RWM use 'ReadWriteMany' and For RWO use 'ReadWriteOnce'
          - name: ACCESS_MODE
            value: 'ReadWriteMany'  

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./e2e-tests/apps/minio/deployers/test.yml -i /etc/ansible/hosts -v; exit 0"]
