---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Kill all openebs control plane pod and check if gets scheduled again
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-control-plane-chaos
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-control-plane-chaos
spec:
  definition:
    scope: Namespaced
    permissions:
      - apiGroups:
          - ""
          - "litmuschaos.io"
          - "batch"
          - "apps"
        resources:
          - "pods"
          - "pods/log"
          - "deployments"
          - "events"
          - "jobs"
          - "configmaps"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "list"
          - "get"
          - "patch"
          - "update"
          - "delete"
      - apiGroups:
          - ""
        resources:
          - "nodes"
        verbs:
          - "get"
          - "list"
      
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-control-plane-chaos/openebs_control_plane_chaos_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NAMESPACE
      value: 'openebs'

    ## Period to wait before injection of chaos  
    - name: RAMP_TIME
      value: ''
    
    - name: FORCE
      value: ''

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

    labels:
      name: openebs-control-plane-chaos
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest

---
---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Kill the cstor target/Jiva controller pod and check if gets created again
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-target-pod-failure
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-target-pod-failure
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "extensions"
          - "apps"
          - "batch"
          - "litmuschaos.io"
          - "storage.k8s.io"
        resources:
          - "deployments"
          - "jobs"
          - "events"
          - "pods"
          - "pods/log"
          - "pods/exec"
          - "configmaps"
          - "secrets"
          - "services"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
          - "persistentvolumeclaims"
          - "storageclasses"
          - "persistentvolumes"
        verbs:
          - "create"
          - "get"
          - "delete"
          - "list"
          - "patch"
          - "update"
      - apiGroups:
          - ""
        resources:
          - "nodes"
        verbs:
          - "get"
          - "list"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-target-pod-failure/openebs_target_pod_failure_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NAMESPACE
      value: 'openebs'
      
    - name: APP_PVC
      value: ''

    - name: FORCE
      value: 'true'

    - name: LIVENESS_APP_LABEL
      value: ''

    - name: LIVENESS_APP_NAMESPACE
      value: ''

    - name: DATA_PERSISTENCE
      value: ''

    - name: TOTAL_CHAOS_DURATION
      value: '60'

     # provide the kill count
    - name: KILL_COUNT
      value: ''

    - name: CHAOS_INTERVAL
      value: '15'

    - name: DEPLOY_TYPE
      value: 'deployment'

    labels:
      name: openebs-target-pod-failure
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    #configmaps:
    #- name: openebs-target-pod-failure
    #  mountPath: /mnt

---
---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    OpenEBS Pool Disk Loss contains chaos to disrupt state of infra resources. Experiments can inject disk loss against openEBS pool.
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-pool-disk-loss
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-pool-disk-loss
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "apps"
          - "litmuschaos.io"
          - "batch"
          - "extensions"
          - "storage.k8s.io"
          - "openebs.io"
        resources:
          - "pods"
          - "jobs"
          - "pods/log"
          - "events"
          - "pods/exec"
          - "cstorpools"
          - "configmaps"
          - "secrets"
          - "storageclasses"
          - "persistentvolumes"
          - "persistentvolumeclaims"
          - "cstorvolumereplicas"
          - "chaosexperiments"
          - "chaosresults"
          - "chaosengines"
        verbs:
          - "create"
          - "list"
          - "get"
          - "patch"
          - "update"
          - "delete"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-pool-disk-loss/openebs_pool_disk_loss_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
      - name: ANSIBLE_STDOUT_CALLBACK
        value: 'default'

      - name: TOTAL_CHAOS_DURATION
        value: '60'

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

       # GKE and AWS supported
      - name: CLOUD_PLATFORM
        value: 'GKE'

      - name: PROJECT_ID 
        value: ''

      - name: NODE_NAME
        value: ''

      - name: DISK_NAME
        value: ''

      - name: ZONE_NAME
        value: ''

      - name: DEVICE_NAME
        value: ''
        
      - name: LIVENESS_APP_LABEL
        value: ''

      - name: LIVENESS_APP_NAMESPACE
        value: ''

      - name: DATA_PERSISTENCE
        value: ''

      - name: OPENEBS_NAMESPACE
        value: 'openebs'
        
    labels:
      name: openebs-pool-disk-loss
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest

    configmaps:
    - name: openebs-pool-disk-loss
      mountPath: /mnt/

    secrets:
    - name: cloud-secret
      mountPath: /tmp/

---
---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Kill the OpenEBS NFS provisioner container and check if pods consuming the NFS PVs continue to be available and volumes are writable (RWM mode)
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-nfs-provisioner-kill
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-nfs-provisioner-kill
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "apps"
          - "litmuschaos.io"
          - "batch"
          - "extensions"
          - "storage.k8s.io"
        resources:
          - "pods"
          - "pods/exec"
          - "pods/log"
          - "deployments"
          - "events"
          - "jobs"
          - "configmaps"
          - "services"
          - "persistentvolumeclaims"
          - "storageclasses"
          - "persistentvolumes"
          - "chaosexperiments"
          - "chaosresults"
          - "chaosengines"
        verbs:
          - "create"
          - "list"
          - "get"
          - "patch"
          - "update"
          - "delete"
      - apiGroups:
          - ""
        resources:
          - "nodes"
        verbs:
          - "get"
          - "list"
      
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-nfs-provisioner-kill/openebs_nfs_provisioner_kill_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    # NFS default container
    - name: TARGET_CONTAINER
      value: 'nfs-provisioner'

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

    # It supports pumba and containerd 
    - name: LIB
      value: 'pumba'

    # LIB_IMAGE can be - gaiaadm/pumba:0.6.5, gprasath/crictl:ci
    # For pumba image use: gaiaadm/pumba:0.6.5
    # For containerd image use: gprasath/crictl:ci
    - name: LIB_IMAGE  
      value: 'gaiaadm/pumba:0.6.5' 

    # provide the chaos interval
    - name: CHAOS_INTERVAL
      value: '10'

    # provide the total chaos duration
    - name: TOTAL_CHAOS_DURATION
      value: '20'

    labels:
      name: openebs-nfs-provisioner-kill
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    configmaps:
      - name: openebs-nfs-provisioner-kill
        mountPath: /mnt/

---
---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Kill the cstor target/Jiva controller container and check if gets created again
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-target-container-failure
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-target-container-failure
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "apps"
          - "batch"
          - "litmuschaos.io"
          - "storage.k8s.io"
        resources:
          - "jobs"
          - "pods"
          - "events"
          - "pods/exec"
          - "pods/log"
          - "configmaps"
          - "secrets"
          - "persistentvolumeclaims"
          - "storageclasses"
          - "persistentvolumes"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "delete"
          - "get"
          - "list"
          - "patch"
          - "update"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-target-container-failure/openebs_target_container_failure_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NAMESPACE
      value: 'openebs'

    - name: APP_PVC
      value: ''

    # LIB_IMAGE can be - gaiaadm/pumba:0.6.5, gprasath/crictl:ci
    # For pumba image use : gaiaadm/pumba:0.6.5
    # For containerd image use : gprasath/crictl:ci
    - name: LIB_IMAGE
      value: 'gaiaadm/pumba:0.6.5'

    # Specify the container runtime used , to pick the relevant chaos util  
    - name: CONTAINER_RUNTIME
      value: 'docker' 

    # TARGET_CONTAINER values: cstor-volume-mgmt , cstor-istgt
    # For cstor-volume-istgt container kill use : cstor-istgt
    # For volume-mgmt-kill container use : cstor-volume-mgmt
            
    - name: TARGET_CONTAINER
      value: 'cstor-volume-mgmt'

    - name: FORCE
      value: 'true'

    - name: LIVENESS_APP_LABEL
      value: ''

    - name: LIVENESS_APP_NAMESPACE
      value: ''

    - name: DATA_PERSISTENCE
      value: ''

    - name: DEPLOY_TYPE
      value: 'deployment'

    # provide the chaos interval
    - name: CHAOS_INTERVAL
      value: '10'

    # provide the total chaos duration
    - name: TOTAL_CHAOS_DURATION
      value: '20'

    - name: SOAK_TIME
      value: '60'
      
    labels:
      name: openebs-target-container-failure
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    #configmaps:
    #- name: openebs-target-container-failure
    #  mountPath: /mnt

---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Network loss to target pod belonging to a OpenEBS PVC
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-target-network-loss
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-target-network-loss
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "extensions"
          - "apps"
          - "batch"
          - "litmuschaos.io"
          - "storage.k8s.io"
        resources:
          - "jobs"
          - "pods"
          - "events"
          - "services"
          - "pods/log"
          - "pods/exec"
          - "configmaps"
          - "secrets"
          - "persistentvolumeclaims"
          - "storageclasses"
          - "persistentvolumes"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "get"
          - "delete"
          - "list"
          - "patch"
          - "update"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-target-network-loss/openebs_target_network_loss_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NAMESPACE
      value: 'openebs'

    - name: APP_PVC
      value: ''

    - name: TC_IMAGE
      value: 'gaiadocker/iproute2'

    # only pumba supported
    # For pumba image use : gaiaadm/pumba:0.6.5
    - name: LIB_IMAGE  
      value: 'gaiaadm/pumba:0.6.5' 

    - name: NETWORK_PACKET_LOSS_PERCENTAGE
      value: '100' # in percentage

    - name: TOTAL_CHAOS_DURATION
      value: '120' # in seconds

    - name: LIVENESS_APP_LABEL
      value: ''

    - name: LIVENESS_APP_NAMESPACE
      value: ''

    - name: DATA_PERSISTENCE
      value: ''

    labels:
      name: openebs-target-network-loss
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    #configmaps:
    #- name: openebs-target-network-loss
    #  mountPath: /mnt

---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Network delay to pool pod belonging to a OpenEBS PVC
    This experiment is using pumba lib for network chaos
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-pool-network-delay
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-pool-network-delay
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "apps"
          - "litmuschaos.io"
          - "batch"
          - "extensions"
          - "storage.k8s.io"
          - "openebs.io"
        resources:
          - "pods"
          - "pods/exec"
          - "jobs"
          - "pods/log"
          - "events"
          - "configmaps"
          - "services"
          - "persistentvolumeclaims"
          - "storageclasses"
          - "persistentvolumes"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
          - "cstorpools"
          - "cstorvolumereplicas"
          - "replicasets"
        verbs:
          - "create"
          - "get"
          - "list"
          - "patch"
          - "update"
          - "delete"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-pool-network-delay/openebs_pool_network_delay_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NAMESPACE
      value: 'openebs'

    # only pumba supported
    # For pumba image use : gaiaadm/pumba:0.6.5
    - name: LIB_IMAGE  
      value: 'gaiaadm/pumba:0.6.5' 

    # in milliseconds
    - name: NETWORK_DELAY
      value: '60000'

    - name: TC_IMAGE
      value: 'gaiadocker/iproute2'

    - name: TOTAL_CHAOS_DURATION
      value: '60' # in seconds

    - name: LIVENESS_APP_LABEL
      value: ''

    - name: LIVENESS_APP_NAMESPACE
      value: ''

    - name: DATA_PERSISTENCE
      value: ''

    labels:
      name: openebs-pool-network-delay
      app.kubernetes.io/part-of: litmus 
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest

---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Network delay to target pod belonging to a deployment/statefulset/daemonset
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-target-network-delay
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-target-network-delay
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "extensions"
          - "apps"
          - "batch"
          - "litmuschaos.io"
          - "storage.k8s.io"
        resources:
          - "jobs"
          - "pods"
          - "services"
          - "events"
          - "pods/exec"
          - "pods/log"
          - "configmaps"
          - "secrets"
          - "persistentvolumeclaims"
          - "storageclasses"
          - "persistentvolumes"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "get"
          - "delete"
          - "list"
          - "patch"
          - "update"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-target-network-delay/openebs_target_network_delay_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NAMESPACE
      value: 'openebs'

    - name: APP_PVC
      value: ''

    - name: TC_IMAGE
      value: 'gaiadocker/iproute2'

    # only pumba supported
    # For pumba image use : gaiaadm/pumba:0.6.5
    - name: LIB_IMAGE
      value: 'gaiaadm/pumba:0.6.5' 

    - name: NETWORK_DELAY
      value: '60000' # in milliseconds

    - name: TOTAL_CHAOS_DURATION
      value: '60' # in seconds
            
    - name: LIVENESS_APP_LABEL
      value: ''

    - name: LIVENESS_APP_NAMESPACE
      value: ''

    - name: DATA_PERSISTENCE
      value: ''   

    labels:
      name: openebs-target-network-delay
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    #configmaps:
    #- name: openebs-target-network-delay
    #  mountPath: /mnt

---
---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Kill the pool container and check if gets scheduled again
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-pool-container-failure
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-pool-container-failure
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "extensions"
          - "apps"
          - "batch"
          - "litmuschaos.io"
          - "openebs.io"
          - "storage.k8s.io"
        resources:
          - "replicasets"
          - "events"
          - "jobs"
          - "pods"
          - "pods/log"
          - "pods/exec"
          - "configmaps"
          - "secrets"
          - "persistentvolumeclaims"
          - "cstorvolumereplicas"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "get"
          - "delete"
          - "list"
          - "patch"
          - "update"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-pool-container-failure/openebs_pool_container_failure_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NS
      value: 'openebs'

    - name: APP_PVC
      value: ''

    - name: LIVENESS_APP_LABEL
      value: ''

    # only pumba supported
    # For pumba image use : gaiaadm/pumba:0.6.5
    - name: LIB_IMAGE  
      value: 'gaiaadm/pumba:0.6.5' 

    - name: LIVENESS_APP_NAMESPACE
      value: '' 

    # provide the chaos interval
    - name: CHAOS_INTERVAL
      value: '10'

    # provide the total chaos duration
    - name: TOTAL_CHAOS_DURATION
      value: '20'

    - name: DATA_PERSISTENCE
      value: ''

    - name: CHAOS_ITERATIONS
      value: '2'

    labels:
      name: openebs-pool-container-failure
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    #configmaps:
    #- name: openebs-pool-container-failure
    #  mountPath: /mnt

---
---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Kill the pool pod and check if gets scheduled again
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-pool-pod-failure
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-pool-pod-failure
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "extensions"
          - "apps"
          - "batch"
          - "litmuschaos.io"
          - "openebs.io"
          - "storage.k8s.io"
        resources:
          - "deployments"
          - "replicasets"
          - "jobs"
          - "pods/log"
          - "events"
          - "pods"
          - "configmaps"
          - "secrets"
          - "storageclasses"
          - "persistentvolumeclaims"
          - "cstorvolumereplicas"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
        verbs:
          - "create"
          - "get"
          - "delete"
          - "list"
          - "patch"
          - "update"
      - apiGroups:
          - ""
        resources:
          - "nodes"
        verbs:
          - "get"
          - "list"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-pool-pod-failure/openebs_pool_pod_failure_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: default

    - name: OPENEBS_NS
      value: 'openebs'

    - name: APP_PVC
      value: ''

    - name: LIVENESS_APP_LABEL
      value: ''

    - name: LIVENESS_APP_NAMESPACE
      value: '' 

    - name: CHAOS_ITERATIONS
      value: '2'

     # provide the kill count
    - name: KILL_COUNT
      value: ''

    - name: DATA_PERSISTENCE
      value: ''

    labels:
      name: openebs-pool-pod-failure
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest
    #configmaps:
    #- name: openebs-pool-pod-failure
    #  mountPath: /mnt
      

---
apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Network loss to pool pod belonging to a OpenEBS PVC
kind: ChaosExperiment
metadata:
  labels:
    litmuschaos.io/name: openebs
    name: openebs-pool-network-loss
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
  name: openebs-pool-network-loss
spec:
  definition:
    scope: Cluster
    permissions:
      - apiGroups:
          - ""
          - "apps"
          - "litmuschaos.io"
          - "batch"
          - "extensions"
          - "storage.k8s.io"
          - "openebs.io"
        resources:
          - "pods"
          - "pods/log"
          - "pods/exec"
          - "events"
          - "jobs"
          - "configmaps"
          - "services"
          - "persistentvolumeclaims"
          - "storageclasses"
          - "persistentvolumeclaims"
          - "persistentvolumes"
          - "chaosengines"
          - "chaosexperiments"
          - "chaosresults"
          - "cstorpools"
          - "cstorvolumereplicas"
          - "replicasets"
        verbs:
          - "create"
          - "get"
          - "delete"
          - "list"
          - "patch"
          - "update"
    image: "litmuschaos/ansible-runner:latest"
    imagePullPolicy: Always
    args:
    - -c
    - ansible-playbook ./experiments/openebs/openebs-pool-network-loss/openebs_pool_network_loss_ansible_logic.yml -i /etc/ansible/hosts -vv; exit 0
    command:
    - /bin/bash
    env:
    - name: ANSIBLE_STDOUT_CALLBACK
      value: 'default'

    - name: OPENEBS_NAMESPACE
      value: 'openebs'

    # only pumba supported
    # For pumba image use : gaiaadm/pumba:0.6.5
    - name: LIB_IMAGE  
      value: 'gaiaadm/pumba:0.6.5' 

    - name: TC_IMAGE
      value: 'gaiadocker/iproute2'

    - name: NETWORK_PACKET_LOSS_PERCENTAGE
      value: '100' # in percentage

    - name: TOTAL_CHAOS_DURATION
      value: '120' # in seconds

    - name: LIVENESS_APP_LABEL
      value: ''

    - name: LIVENESS_APP_NAMESPACE
      value: ''

    - name: DATA_PERSISTENCE
      value: ''

    labels:
      name: openebs-pool-network-loss
      app.kubernetes.io/part-of: litmus
      app.kubernetes.io/component: experiment-job
      app.kubernetes.io/version: latest

---
