---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-prometheus-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        app: prometheus-deployment-litmus

    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: IfNotPresent

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays, actionable, default
            value: default

          - name: PROVIDER_STORAGE_CLASS
            # use any openebs supported storage class
            value: openebs-cstor-sparse

          - name: APP_PVC
            value: 'prometheus-claim'

            # Application label
          - name: APP_LABEL
            value: 'name=prometheus'

            # Application namespace
          - name: APP_NAMESPACE
            value: 'app-prometheus'

            # Use 'deprovision' for app-clean up
          - name: ACTION
            value: provision 
          
          - name: VOLUME_CAPACITY
            value: "25Gi"

          - name: AFFINITY_LABEL
            value: openebs.io/target-affinity

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

