---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: openebs-app-svc-chaos-
  namespace: litmus 
spec:
  template:
    metadata:
      labels:
        name: openebs-app-svc-chaos
    spec:
      serviceAccountName: litmus
      restartPolicy: Never

      #nodeSelector:
      #  kubernetes.io/hostname:

      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: Always
        env: 
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            #value: actionable
            value: default

          - name: OPERATOR_NAMESPACE
            value: openebs
 
          - name: APP_NAMESPACE
            value: app-percona-ns 

          - name: APP_LABEL
            value: 'name=percona'

          - name: APP_PVC
            value: percona-mysql-claim

          - name: SVC_CHAOS
            value: docker

          - name: CHAOS_DURATION
            value: "300" # in seconds

          - name: LIVENESS_APP_LABEL
            value: "liveness=percona-liveness"

          - name: LIVENESS_APP_NAMESPACE
            value: "litmus"

          - name: PLATFORM
            value: "AWS"

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

