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

    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: IfNotPresent

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

          - name: PROVIDER_STORAGE_CLASS
            value: openebs-standard

          - 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

          - name: TARGET_AFFINITY
            value: ""
          
          - name: TARGET_AFFINITY_CHECK
            value: enable

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