---
apiVersion: batch/v1
kind: Job
metadata:
  generateName: k8-pod-delete-
spec:
  template:
    metadata:
      labels:
        experiment: k8-pod-delete
    spec:
      # Placeholder that is updated by the executor for automated runs
      # Provide appropriate SA (with desired permissions) if executed manually

      serviceAccountName: '%CHAOS_SERVICE_ACCOUNT%'
      restartPolicy: Never
      containers:
      - name: chaostoolkit
        image: litmuschaos/chaostest:latest
        imagePullPolicy: Always
        env:
          - name: FILE
            value: 'pod-app-kill-count.json'

          - name: LABEL_NAME
            value: ''

          # provide application namespace
          - name: NAME_SPACE
            value: ''

          # provide application labels
          - name: APP_ENDPOINT
            value: 'localhost'

          # provide application labels
          - name: PERCENTAGE
            value: '50'

          - name: CHAOSTOOLKIT_IN_POD
            value: "true"

          ## env var that describes the library used to execute the chaos
          ## default: litmus. Supported values: litmus, powerfulseal, chaostoolkit
          - name: LIB
            value: ''

          - name: REPORT
            value: 'false'

          # Variable to set for report upload endpoint
          - name: REPORT_ENDPOINT
            value: 'none'



          - name: CHAOS_SERVICE_ACCOUNT
            valueFrom:
              fieldRef:
                fieldPath: spec.serviceAccountName

        command: ["/bin/bash"]
        args: ["-c", "sleep 10000; exit 0"]
