---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: litmus-replica-scale-
  namespace: litmus
spec:
  template:
    metadata:
      name: litmus
      labels:
        app: cassandra-scaleup-litmus

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

        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            value: default

            # Application label
          - name: APP_LABEL
            value: 'app=cassandra'

            # Application namespace
          - name: APP_NAMESPACE
            value: app-cass-ns

            # Deployment type either statefulset or deployment
          - name: DEPLOY_TYPE
            value: statefulset

            # The total number of replicas
          - name: REPLICA_COUNT
            value: '2'

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