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

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

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

          - name: PROVIDER_STORAGE_CLASS
            value: openebs-jiva-csi

          - name: APP_PVC
            value: percona-mysql-claim

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

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

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

          - name: CAPACITY
            value: 5Gi
            
            # Enable storage i/o based liveness probe
          - name: IO_PROBE
            value: enabled

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