---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: ephemeral-storage-
  namespace: e2e
spec:
  template:
    metadata:
      labels:
        name: ephemeral-storage
    spec:
      serviceAccountName: e2e
      restartPolicy: Never
      #nodeSelector:
      #  kubernetes.io/hostname:

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

          - name: APP_NAMESPACE
            value: app-percona-ns

          - name: APP_PVC
            value: percona-mysql-claim

          - name: APP_LABEL
            value: 'name=percona'

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

          - name: LIVENESS_APP_NAMESPACE
            value: "e2e"

          - name: DATA_PERSISTENCY
            value: "enable"

          - name: PLATFORM
            value: "GKE"

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./experiments/chaos/ephemeral-storage/test.yml -i /etc/ansible/hosts -vv; exit 0"]
        volumeMounts:
          - name: logs
            mountPath: /var/log/ansible
        tty: true


