apiVersion: litmuschaos.io/v1alpha1
description:
  message: |
    Injects network packet duplication on pods belonging to an app deployment
kind: ChaosExperiment
metadata:
  name: pod-network-duplication
  labels:
    name: pod-network-duplication
    app.kubernetes.io/part-of: litmus
    app.kubernetes.io/component: chaosexperiment
    app.kubernetes.io/version: latest
spec:
  definition:
    scope: Namespaced
    permissions:
    - apiGroups:
        - ""
        - "batch"
        - "litmuschaos.io"
      resources:
        - "jobs"
        - "pods"
        - "pods/log"
        - "events"
        - "chaosengines"
        - "chaosexperiments"
        - "chaosresults"
      verbs:
        - "get"
        - "list"
        - "patch"
        - "create"
        - "update"
        - "delete"
        - "deletecollection"
    image: "litmuschaos/go-runner:latest"
    args:
    - -c
    - ./experiments -name pod-network-duplication
    command:
    - /bin/bash
    env:
    - name: TOTAL_CHAOS_DURATION
      value: '60'

    - name: RAMP_TIME
      value: ''

    - name: TARGET_CONTAINER
      value: ''

    - name: TC_IMAGE
      value: 'gaiadocker/iproute2'

    - name: NETWORK_INTERFACE
      value: 'eth0'

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

    - name: LIB
      value: 'litmus'   

    - name: TARGET_PODS
      value: ''   

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

    - name: LIB_IMAGE
      value: 'litmuschaos/go-runner:latest'

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

    # provide the target ips
    # chaos injection will be triggered for these destination ips
    - name: TARGET_IPS
      value: ''

    # provide the target hosts
    # chaos injection will be triggered for these destination hosts
    - name: TARGET_HOSTS
      value: ''

    # provide the socket file path
    # applicable only for containerd and crio runtime
    - name: SOCKET_PATH
      value: '/run/containerd/containerd.sock'

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

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