---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-mysql-storage-benchmark-
  namespace: litmus
spec:
  template:
    metadata:
      labels:
        name: litmus
    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            value: default

          - name: PROVIDER_STORAGE_CLASS
            value: openebs-standard
            #value: local-storage

          - name: APP_NODE_SELECTOR
            value: kubeminion-01

        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./percona/tests/mysql_storage_benchmark/test.yml -i /etc/ansible/hosts -v; exit 0"]
        volumeMounts:
          - name: logs
            mountPath: /var/log/ansible
        tty: true
      - name: logger
        image: openebs/logger
        command: ["/bin/bash"]
        args: ["-c", "./logger.sh -d 10 -r maya,openebs,pvc,percona; exit 0"]
        volumeMounts:
          - name: kubeconfig
            mountPath: /root/admin.conf
            subPath: admin.conf
          - name: logs
            mountPath: /mnt
        tty: true
      volumes:
        - name: kubeconfig
          configMap:
            name: kubeconfig
        - name: logs
          hostPath:
            path: /mnt/mysql_storage_benchmark
            type: ""

