---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: e2e-fio-
  namespace: e2e
spec:
  template:
    metadata:
       name: e2e
       labels:
         app: fio-benchmark-e2e
    spec:
      serviceAccountName: e2e
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default

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

          - name: APP_NODE_SELECTOR
            value: kubeminion-01

          # this template is used for random write with sync
          - name: FIO_TEST_PROFILE
            value: basic-write

          # 1024m data will be written randomly so that more
          # extents will be generated and will delay adding replica
          - name: FIO_SAMPLE_SIZE
            value: "1024m"

          # Setting to zero such that fio completes running load
          - name: FIO_TESTRUN_PERIOD
            value: "0"

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