---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    IO stress on a app pods belonging to an app deployment
kind: ChaosExperiment
metadata:
  name: pod-io-stress
  labels:
    name: pod-io-stress
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
spec:
  definition:
    scope: Namespaced
    permissions:
      - apiGroups:
          - ""
          - "batch"
          - "apps"
          - "apps.openshift.io"
          - "argoproj.io"
          - "litmuschaos.io"
        resources:
          - "jobs"
          - "pods"
          - "pods/log"
          - "replicationcontrollers"
          - "deployments"
          - "statefulsets"
          - "daemonsets"
          - "replicasets"
          - "deploymentconfigs"
          - "rollouts"
          - "pods/exec"
          - "events"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "list"
          - "get"
          - "patch"
          - "update"
          - "delete"
          - "deletecollection"
    image: "litmuschaos/go-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ./experiments -name pod-io-stress
    command:
    - /bin/bash
    env:
      - name: TOTAL_CHAOS_DURATION
        value: '120'

      ## specify the size as percentage of free space on the file system
      ## default value 90 (in percentage)
      - name: FILESYSTEM_UTILIZATION_PERCENTAGE
        value: '10'

      ## we can specify the size in Gigabyte (Gb) also in place of percentage of free space
      ## NOTE: for selecting this option FILESYSTEM_UTILIZATION_PERCENTAGE should be empty
      - name: FILESYSTEM_UTILIZATION_BYTES
        value: ''

      ## Total number of workers default value is 4
      - name: NUMBER_OF_WORKERS
        value: '4'    

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

      # provide volume mount path
      - name: VOLUME_MOUNT_PATH
        value: ''

      ## specify the comma separated target pods
      - name: TARGET_PODS
        value: ''    

      # Period to wait before and after injection of chaos in sec
      - name: RAMP_TIME
        value: ''

      # Provide the LIB here
      # Only pumba supported
      - name: LIB
        value: 'pumba'

      # provide lib image
      - name: LIB_IMAGE
        value: 'litmuschaos/go-runner:latest'

      # provide the socket file path
      # it is used in pumba lib
      - name: SOCKET_PATH
        value: '/var/run/docker.sock'         

      ## it defines the sequence of chaos execution for multiple target pods
      ## supported values: serial, parallel
      - name: SEQUENCE
        value: 'parallel'

    labels:
      name: pod-io-stress
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
