apiVersion: batch/v1
kind: Job
metadata:
  name: chaos-test-case
spec:
  template:
    spec:
      containers:
        - name: chaos-test-case
          image: dm:chaos # build this image in GitHub action workflow
          imagePullPolicy: IfNotPresent
          env:
            - name: MY_POD_NAME
              valueFrom:
                fieldRef:
                  fieldPath: metadata.name
            - name: MY_POD_NAMESPACE
              valueFrom:
                fieldRef:
                  fieldPath: metadata.namespace
          ports:
            - containerPort: 80
              name: chaos-test-case
          command:
            - "/chaos-case"
            - "--config-dir=/conf" # we put config files into `/conf` when building the docker image
            - "--duration=20m"
      restartPolicy: Never
  backoffLimit: 0 # fail immediately
