---
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
  name: nginx-chaos
spec:
  # It can be active/stop
  engineState: 'active'
  appinfo:
    appns: ''
    applabel: ''
    appkind: ''
  chaosServiceAccount: pod-http-status-code-sa
  experiments:
    - name: pod-http-status-code
      spec:
        components:
          env:
            # set chaos duration (in sec) as desired
            - name: TOTAL_CHAOS_DURATION
              value: '30'

            # set chaos interval (in sec) as desired
            - name: CHAOS_INTERVAL
              value: '10'

            # modified status code for the HTTP response
            # if no value is provided, a random status code from the supported code list will selected
            # if an invalid status code is provided, the experiment will fail
            # supported status code list: [200, 201, 202, 204, 300, 301, 302, 304, 307, 400, 401, 403, 404, 500, 501, 502, 503, 504
            - name: STATUS_CODE
              value: ''

            #  whether to modify the body as per the status code provided
            - name: "MODIFY_RESPONSE_BODY"
              value: "true"

            # port of the target service
            - name: TARGET_SERVICE_PORT
              value: "80"

            # provide the name of container runtime
            # it supports docker, containerd, crio
            - name: CONTAINER_RUNTIME
              value: 'containerd'

            # provide the socket file path
            - name: SOCKET_PATH
              value: '/run/containerd/containerd.sock'

             ## percentage of total pods to target
            - name: PODS_AFFECTED_PERC
              value: ''

