---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: node-failure-taint-
  namespace: litmus
spec:
  template:
    metadata:
      labels:
        name: node-failure-taint
    spec:
      serviceAccountName: litmus
      restartPolicy: Never
      #nodeSelector:
      #  kubernetes.io/hostname: 
      
      tolerations:
      - key: "infra-aid"
        operator: "Equal"
        value: "observer"
        effect: "NoSchedule"

      containers:
      - name: ansibletest
        image: openebs/ansible-runner:ci
        imagePullPolicy: IfNotPresent
        env:
          - name: ANSIBLE_STDOUT_CALLBACK
            #value: log_plays
            #value: actionable
            value: default

          - name: APP_NAMESPACE
            value: app-percona-ns 

          - name: APP_LABEL
            value: 'name=percona'

          - name: LIVENESS_APP_LABEL
            value: "liveness=percona-liveness"

          - name: LIVENESS_APP_NAMESPACE
            value: "litmus"

          - name: TAINT_KEY
            value: 'node.kubernetes.io/out-of-disk'

          - name: DATA_PERSISTENCY
            value: "enable"
        command: ["/bin/bash"]
        args: ["-c", "ansible-playbook ./experiments/chaos/taint_node/test.yml -i /etc/ansible/hosts -vv; exit 0"]
