---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: cockroachdb-loadgen-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        loadgen: cockroachdb-loadjob
    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: loadgen
        image: openebs/ansible-runner:ci
        imagePullPolicy: Always
        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default

          - name: APP_NS
            value: app-cdb-ns

          - name: APP_LABEL
            value: 'app=cockroachdb'

          - name: LOADGEN_LABEL
            value: 'loadgen=cockroachdb-load'

          - name: TIME_INTERVAL
            value: 5m

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