From 61b54901f5512e1b292234ec4be1fa144f857b55 Mon Sep 17 00:00:00 2001 From: Sky Singh Date: Sun, 18 May 2025 19:02:49 +0530 Subject: [PATCH 1/4] Enhance chaos experiment documentation and configuration for multiple experiments. Updated environment variables, added SDK authentication details, and improved clarity on chaos execution processes across various chaos experiments including container-kill, disk-fill, node-cpu-hog, and others. Updated image references to use the latest version and standardized configuration parameters. Signed-off-by: Sky Singh --- experiments/container-kill/README.md | 328 ++++++++++++++--- experiments/disk-fill/README.md | 331 ++++++++++++++--- experiments/node-cpu-hog/README.md | 312 +++++++++++++--- experiments/node-io-stress/README.md | 314 +++++++++++++--- experiments/node-memory-hog/README.md | 311 +++++++++++++--- experiments/pod-autoscaler/README.md | 329 ++++++++++++++--- experiments/pod-cpu-hog/README.md | 323 +++++++++++++--- experiments/pod-delete/README.md | 319 +++++++++++++--- experiments/pod-memory-hog/README.md | 319 +++++++++++++--- experiments/pod-network-corruption/README.md | 336 ++++++++++++++--- experiments/pod-network-duplication/README.md | 336 ++++++++++++++--- experiments/pod-network-latency/README.md | 347 ++++++++++++++---- experiments/pod-network-loss/README.md | 340 +++++++++++++---- 13 files changed, 3532 insertions(+), 713 deletions(-) diff --git a/experiments/container-kill/README.md b/experiments/container-kill/README.md index 6cffae9..53f751a 100644 --- a/experiments/container-kill/README.md +++ b/experiments/container-kill/README.md @@ -23,30 +23,58 @@ jobs: uses: litmuschaos/github-chaos-actions@v0.4.0 env: KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "container-kill-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info APP_NS: default APP_LABEL: run=nginx APP_KIND: deployment + + # Experiment Configuration EXPERIMENT_NAME: container-kill - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 IMAGE_PULL_POLICY: Always + + # Container Kill Specific Configuration TARGET_CONTAINER: nginx TOTAL_CHAOS_DURATION: 20 CHAOS_INTERVAL: 10 - CONTAINER_RUNTIME: docker - ##Select true if you want to uninstall litmus after chaos + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + SIGNAL: SIGKILL + SEQUENCE: parallel + PODS_AFFECTED_PERC: 100 + DEFAULT_HEALTH_CHECK: false + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for container-kill will be identified with the app info variables. +The following environment variables are used to configure the container-kill experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -56,81 +84,297 @@ The application pod for container-kill will be identified with the app info vari - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running container kill experiment keep it container-kill LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
TARGET_CONTAINER The name of container to be killed inside the pod LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is nginx true
CHAOS_INTERVAL Time interval b/w two successive container kill (in seconds) USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is 10s false
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional ci-infra-container-kill
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional Default value is 20s 200
+ +### Application Info Variables + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Container Kill Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + - + + + + + + + - - + + + + + + + + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running container kill experiment keep it container-kill Mandatory No default value
TARGET_CONTAINER The name of container to be killed inside the pod Optional Default value is not set to true nginx
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
CHAOS_INTERVAL Time interval b/w two successive container kills (in seconds) Optional Default value is not set to true 10
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 20
CONTAINER_RUNTIME Give the target container runtime Optional Default value is 'docker'
containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always Always
SIGNAL Signal to be sent to the container Optional SIGKILL
SEQUENCE Sequence of chaos execution Optional parallel
DEFAULT_HEALTH_CHECK Enable/disable default health checks Optional false
RAMP_TIME Time to wait before and after chaos injection (in seconds) Optional Not set
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/disk-fill/README.md b/experiments/disk-fill/README.md index 9892ce1..2c8d49b 100644 --- a/experiments/disk-fill/README.md +++ b/experiments/disk-fill/README.md @@ -19,35 +19,60 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running disk-fill chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: disk-fill - FILL_PERCENTAGE: 80 - TARGET_CONTAINER: nginx - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running disk-fill chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "disk-fill-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: disk-fill + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Disk Fill Specific Configuration + FILL_PERCENTAGE: 80 + TARGET_CONTAINER: nginx + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + TOTAL_CHAOS_DURATION: 60 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for disk-fill will be identified with the app info variables. +The following environment variables are used to configure the disk-fill experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -57,69 +82,273 @@ The application pod for disk-fill will be identified with the app info variables - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running disk fill experiment keep it disk-fill LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
TARGET_CONTAINER Name of container which is subjected to disk-fill LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is nginx
true
FILL_PERCENTAGE Percentage to fill the Ephemeral storage limit USE_EXISTING_INFRA Whether to use existing infrastructure Optional false
EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional ci-infra-disk-fill
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional Default value is 2 200
+ +### Application Info Variables + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Disk Fill Experiment Variables + + - - + + + + + + + + + + + + + + - + + + + + + + - - - + + + + + + + + + - + + + + + + + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running disk fill experiment keep it disk-fill Mandatory No default value
TARGET_CONTAINER Name of container which is subjected to disk-fill Optional Default value is not set to true nginx
FILL_PERCENTAGE Percentage to fill the Ephemeral storage limit Optional 80
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
CONTAINER_RUNTIME Give the target container runtime Optional containerd
SOCKET_PATH Socket path for the container runtime Optional Default value is not set to true /run/containerd/containerd.sock
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 60
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/node-cpu-hog/README.md b/experiments/node-cpu-hog/README.md index 0f8d550..3dddac9 100644 --- a/experiments/node-cpu-hog/README.md +++ b/experiments/node-cpu-hog/README.md @@ -17,35 +17,59 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running node-cpu-hog chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: node-cpu-hog - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TOTAL_CHAOS_DURATION: 60 - NODE_CPU_CORE: 2 - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running node-cpu-hog chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "node-cpu-hog-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: node-cpu-hog + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Node CPU Hog Specific Configuration + TOTAL_CHAOS_DURATION: 60 + NODE_CPU_CORE: 2 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for node-cpu-hog will be identified with the app info variables. +The following environment variables are used to configure the node-cpu-hog experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -55,69 +79,255 @@ The application pod for node-cpu-hog will be identified with the app info variab - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running node cpu hog experiment keep it node-cpu-hog LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
NODE_CPU_CORE Number of cores of node CPU to be consumed LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is 2 true
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is 60s
false
EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional ci-infra-node-cpu-hog
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Node CPU Hog Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + - + + + + + + + + + + + + + - + - + - + - - + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running node cpu hog experiment keep it node-cpu-hog Mandatory No default value
NODE_CPU_CORE Number of cores of node CPU to be consumed Optional Default value is not set to true 2
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
CONTAINER_RUNTIME Give the target container runtime Optional Default value is not set to true containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 60
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/node-io-stress/README.md b/experiments/node-io-stress/README.md index e840650..32e631e 100644 --- a/experiments/node-io-stress/README.md +++ b/experiments/node-io-stress/README.md @@ -1,7 +1,7 @@ # Node IO Stress Experiment This experiment causes IO stress on the Kubernetes node. The experiment aims to verify the resiliency of applications that share this disk resource for ephemeral or persistent storage purposes. -. Check node io stress docs for more info. To know more and get started with chaos-actions visit github-chaos-actions. +Check node io stress docs for more info. To know more and get started with chaos-actions visit github-chaos-actions. #### Sample workflow @@ -16,35 +16,59 @@ on: branches: [ master ] jobs: build: - runs-on: ubuntu-latest steps: - - name: Running node-io-stress chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##if litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: node-io-stress - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TOTAL_CHAOS_DURATION: 120 - FILESYSTEM_UTILIZATION_PERCENTAGE: 10 - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running node-io-stress chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "node-io-stress-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: node-io-stress + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Node IO Stress Specific Configuration + TOTAL_CHAOS_DURATION: 120 + FILESYSTEM_UTILIZATION_PERCENTAGE: 10 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The target node for node-io-stress will be identified with the app info variables. +The following environment variables are used to configure the node-io-stress experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -54,69 +78,255 @@ The target node for node-io-stress will be identified with the app info variable - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running node io stress experiment keep it node-io-stress LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
FILESYSTEM_UTILIZATION_PERCENTAGE The size as percent of total available filesystem space (in percentage) LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is 10 true
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is 120s
false
EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional ci-infra-node-io-stress
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Node IO Stress Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + - + + + + + + + + + + + + + - + - + - + - - + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running node io stress experiment keep it node-io-stress Mandatory No default value
FILESYSTEM_UTILIZATION_PERCENTAGE The size as percent of total available filesystem space (in percentage) Optional Default value is not set to true 10
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
CONTAINER_RUNTIME Give the target container runtime Optional Default value is not set to true containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 120
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/node-memory-hog/README.md b/experiments/node-memory-hog/README.md index b3209a3..9f61653 100644 --- a/experiments/node-memory-hog/README.md +++ b/experiments/node-memory-hog/README.md @@ -19,32 +19,57 @@ jobs: build: runs-on: ubuntu-latest steps: - - name: Running node-memory-hog chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##if litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: node-memory-hog - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TOTAL_CHAOS_DURATION: 120 - MEMORY_PERCENTAGE: 90 - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running node-memory-hog chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "node-memory-hog-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: node-memory-hog + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Node Memory Hog Specific Configuration + TOTAL_CHAOS_DURATION: 120 + MEMORY_PERCENTAGE: 90 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for node-memory-hog will be identified with the app info variables. +The following environment variables are used to configure the node-memory-hog experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -54,69 +79,255 @@ The application pod for node-memory-hog will be identified with the app info var - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running node memory hog experiment keep it node-memory-hog LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
MEMORY_PERCENTAGE The size as percent of total available memory LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is 90 true
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is 120s
false
EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional ci-infra-node-memory-hog
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Node Memory Hog Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + - + + + + + + + + + + + + + - + - + - + - - + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running node memory hog experiment keep it node-memory-hog Mandatory No default value
MEMORY_PERCENTAGE The size as percent of total available memory Optional Default value is not set to true 90
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
CONTAINER_RUNTIME Give the target container runtime Optional Default value is not set to true containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 120
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-autoscaler/README.md b/experiments/pod-autoscaler/README.md index 9483d6d..06d3d7b 100644 --- a/experiments/pod-autoscaler/README.md +++ b/experiments/pod-autoscaler/README.md @@ -15,34 +15,60 @@ on: branches: [ master ] jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod autoscaler chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-autoscaler - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TOTAL_CHAOS_DURATION: 60 - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod autoscaler chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-autoscaler-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-autoscaler + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod Autoscaler Specific Configuration + TOTAL_CHAOS_DURATION: 60 + CHAOS_INTERVAL: 5 + REPLICAS: 2 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for pod-autoscaler will be identified with the app info variables. +The following environment variables are used to configure the pod-autoscaler experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -52,68 +78,273 @@ The application pod for pod-autoscaler will be identified with the app info vari - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running pod autoscaler experiment keep it pod-autoscaler LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
CHAOS_INTERVAL Time interval b/w two successive pod failures (in sec) LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is 5s true
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) USE_EXISTING_INFRA Whether to use existing infrastructure Optional false
EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional ci-infra-pod-autoscaler
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional Defaults to 15s, NOTE: Overall run duration of the experiment may exceed the TOTAL_CHAOS_DURATION by a few min SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Pod Autoscaler Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running pod autoscaler experiment keep it pod-autoscaler Mandatory No default value
CHAOS_INTERVAL Time interval b/w two successive pod failures (in sec) Optional Default value is not set to true 5
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
REPLICAS Number of replicas to scale Optional 2
CONTAINER_RUNTIME Give the target container runtime Optional Default value is not set to true containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 60
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-cpu-hog/README.md b/experiments/pod-cpu-hog/README.md index 3386567..9fc056c 100644 --- a/experiments/pod-cpu-hog/README.md +++ b/experiments/pod-cpu-hog/README.md @@ -17,36 +17,59 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod-cpu-hog chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-cpu-hog - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TARGET_CONTAINER: nginx - TOTAL_CHAOS_DURATION: 60 - CPU_CORES: 1 - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod-cpu-hog chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-cpu-hog-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-cpu-hog + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod CPU Hog Specific Configuration + TARGET_CONTAINER: nginx + TOTAL_CHAOS_DURATION: 60 + CPU_CORES: 1 + PODS_AFFECTED_PERC: 100 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for pod-cpu-hog will be identified with the app info variables. +The following environment variables are used to configure the pod-cpu-hog experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -56,75 +79,261 @@ The application pod for pod-cpu-hog will be identified with the app info variabl - - + + - - - + + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running pod cpu hog experiment keep it pod-cpu-hog LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
TARGET_CONTAINER Name of the container subjected to CPU stress
LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - + - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is nginx true
CPU_CORES Number of the cpu cores subjected to CPU stress USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is 1 false
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional Default value is 60s
ci-infra-pod-cpu-hog
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Pod CPU Hog Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + - + + + + + + + - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running pod cpu hog experiment keep it pod-cpu-hog Mandatory No default value
TARGET_CONTAINER Name of the container subjected to CPU stress Optional Default value is not set to true nginx
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
CPU_CORES Number of the cpu cores subjected to CPU stress Optional Default value is not set to true 1
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 60
EXPERIMENT_IMAGE We can provide custom image for running litmus chaos experiment We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-delete/README.md b/experiments/pod-delete/README.md index 22f583e..681bb06 100644 --- a/experiments/pod-delete/README.md +++ b/experiments/pod-delete/README.md @@ -17,36 +17,59 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod delete chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-delete - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TOTAL_CHAOS_DURATION: 30 - CHAOS_INTERVAL: 10 - FORCE: false - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod delete chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-delete-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-delete + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod Delete Specific Configuration + TOTAL_CHAOS_DURATION: 30 + CHAOS_INTERVAL: 10 + FORCE: false + PODS_AFFECTED_PERC: 100 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for pod-delete will be identified with the app info variables. +The following environment variables are used to configure the pod-delete experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -56,81 +79,261 @@ The application pod for pod-delete will be identified with the app info variable - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running pod delete experiment keep it pod-delete LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
TARGET_CONTAINER The name of container to be killed inside the pod LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - + - - + + + + + + + + - + - - - + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is nginx true
CHAOS_INTERVAL Time interval b/w two successive pod failures (in sec) USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is 5s false
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional Defaults to 15s, NOTE: Overall run duration of the experiment may exceed the TOTAL_CHAOS_DURATION by a few min ci-infra-pod-delete
FORCE Application Pod failures type
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional Default value false 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Pod Delete Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + + + + + + + - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running pod delete experiment keep it pod-delete Mandatory No default value
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional Default value is not set to true 15
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
CHAOS_INTERVAL Time interval b/w two successive pod failures (in sec) Optional 5
FORCE Application Pod failures type Optional Default value is not set to true false
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-memory-hog/README.md b/experiments/pod-memory-hog/README.md index 028ae08..423ba80 100644 --- a/experiments/pod-memory-hog/README.md +++ b/experiments/pod-memory-hog/README.md @@ -17,36 +17,59 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod-memory-hog chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-cpu-hog - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TARGET_CONTAINER: nginx - TOTAL_CHAOS_DURATION: 60 - MEMORY_CONSUMPTION: 500 - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod-memory-hog chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-memory-hog-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-memory-hog + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod Memory Hog Specific Configuration + TARGET_CONTAINER: nginx + TOTAL_CHAOS_DURATION: 60 + MEMORY_CONSUMPTION: 500 + PODS_AFFECTED_PERC: 100 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for pod-cpu-hog will be identified with the app info variables. +The following environment variables are used to configure the pod-memory-hog experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -56,75 +79,261 @@ The application pod for pod-cpu-hog will be identified with the app info variabl - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running pod memory hog experiment keep it pod-memory-hog LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
MEMORY_CONSUMPTION The amount of memory used of hogging a Kubernetes pod LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - + - - + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is 500M true
TARGET_CONTAINER Name of the container subjected to CPU stress. USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is nginx false
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional Default value is 120s
ci-infra-pod-memory-hog
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Pod Memory Hog Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + + + + + + + - + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running pod memory hog experiment keep it pod-memory-hog Mandatory No default value
MEMORY_CONSUMPTION The amount of memory used of hogging a Kubernetes pod Optional Default value is not set to true 500M
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
TARGET_CONTAINER Name of the container subjected to memory stress Optional nginx
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional Default value is not set to true 120
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-network-corruption/README.md b/experiments/pod-network-corruption/README.md index 250e9d7..066922f 100644 --- a/experiments/pod-network-corruption/README.md +++ b/experiments/pod-network-corruption/README.md @@ -17,37 +17,61 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod network corruption chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-network-corruption - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TARGET_CONTAINER: nginx - TOTAL_CHAOS_DURATION: 60 - NETWORK_INTERFACE: eth0 - CONTAINER_RUNTIME: docker - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod network corruption chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-network-corruption-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-network-corruption + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod Network Corruption Specific Configuration + TARGET_CONTAINER: nginx + TOTAL_CHAOS_DURATION: 60 + NETWORK_INTERFACE: eth0 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + PODS_AFFECTED_PERC: 100 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for pod-network-corruption will be identified with the app info variables. +The following environment variables are used to configure the pod-network-corruption experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -57,81 +81,273 @@ The application pod for pod-network-corruption will be identified with the app i - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running pod network corruption experiment keep it pod-network-corruption LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
NETWORK_INTERFACE Name of ethernet interface considered for shaping traffic LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - + - - + + + + + + + + - - + + - - + + - - + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is eth0 true
TARGET_CONTAINER Name of container which is subjected to network corruption. USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is nginx false
CONTAINER_RUNTIME Give the target container runtime EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional Default value is 'docker'
ci-infra-pod-network-corruption
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional Default value is 120s
litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Pod Network Corruption Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + - + + + + + + + + + + + + + + + + + + + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running pod network corruption experiment keep it pod-network-corruption Mandatory No default value
NETWORK_INTERFACE Name of ethernet interface considered for shaping traffic Optional Default value is not set to true eth0
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
TARGET_CONTAINER Name of container which is subjected to network corruption Optional Default value is not set to true nginx
CONTAINER_RUNTIME Give the target container runtime Optional containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 120
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-network-duplication/README.md b/experiments/pod-network-duplication/README.md index c3006d0..982f672 100644 --- a/experiments/pod-network-duplication/README.md +++ b/experiments/pod-network-duplication/README.md @@ -15,37 +15,61 @@ on: branches: [ master ] jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod network duplication chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-network-duplication - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TARGET_CONTAINER: nginx - TOTAL_CHAOS_DURATION: 60 - NETWORK_INTERFACE: eth0 - CONTAINER_RUNTIME: docker - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod network duplication chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-network-duplication-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-network-duplication + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod Network Duplication Specific Configuration + TARGET_CONTAINER: nginx + TOTAL_CHAOS_DURATION: 60 + NETWORK_INTERFACE: eth0 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + PODS_AFFECTED_PERC: 100 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for pod-network-duplication will be identified with the app info variables. +The following environment variables are used to configure the pod-network-duplication experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -55,81 +79,273 @@ The application pod for pod-network-duplication will be identified with the app - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running pod network duplication experiment keep it pod-network-duplication LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
NETWORK_INTERFACE Name of ethernet interface considered for shaping traffic LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - + + - + - - + + + + + + + + - - + + - - + + - - + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is eth0 true
TARGET_CONTAINER Name of container which is subjected to network duplication. USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default value is nginx false
CONTAINER_RUNTIME Give the target container runtime EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional Default value is 'docker'
ci-infra-pod-network-duplication
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional Default value is 120s
litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Pod Network Duplication Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running pod network duplication experiment keep it pod-network-duplication Mandatory No default value
NETWORK_INTERFACE Name of ethernet interface considered for shaping traffic Optional Default value is not set to true eth0
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
TARGET_CONTAINER Name of container which is subjected to network duplication Optional nginx
CONTAINER_RUNTIME Give the target container runtime Optional Default value is not set to true containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 120
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-network-latency/README.md b/experiments/pod-network-latency/README.md index 17bd061..b0367ff 100644 --- a/experiments/pod-network-latency/README.md +++ b/experiments/pod-network-latency/README.md @@ -17,38 +17,62 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod-network-latency chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - #If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-network-latency - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TARGET_CONTAINER: nginx - TOTAL_CHAOS_DURATION: 60 - NETWORK_INTERFACE: eth0 - NETWORK_LATENCY: 60000 - CONTAINER_RUNTIME: docker - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod-network-latency chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-network-latency-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-network-latency + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod Network Latency Specific Configuration + TARGET_CONTAINER: nginx + TOTAL_CHAOS_DURATION: 60 + NETWORK_INTERFACE: eth0 + NETWORK_LATENCY: 60000 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + PODS_AFFECTED_PERC: 100 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables -The application pod for pod-network-latency will be identified with the app info variables. +The following environment variables are used to configure the pod-network-latency experiment. -**Supported Chaos Action Tunables** +### SDK Authentication Variables (Required) @@ -58,88 +82,279 @@ The application pod for pod-network-latency will be identified with the app info - - + + - - + + + + + + + + + + + + + + + + + +
Default Value
EXPERIMENT_NAME For Running pod network latency experiment keep it pod-network-latency LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
NETWORK_INTERFACE Name of ethernet interface considered for shaping traffic LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + - + - - - + + + - + - - + + + + + + + + - - + + - - + + - + - - + + - - + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional Default value is eth0 true
NETWORK_LATENCY The latency/delay in milliseconds
USE_EXISTING_INFRA Whether to use existing infrastructure Optional Default (60000ms) false
CONTAINER_RUNTIME Give the target container runtime EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional Default value is 'docker'
ci-infra-pod-network-latency
TARGET_CONTAINER Name of container which is subjected to network latency. INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional Default value is nginx litmus
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) INFRA_SCOPE Scope of infrastructure Optional Default value is 120s
namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
+ +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + - + - - + + - + - - - + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional Default value is default default
APP_LABEL Provide application label of application under chaos. APP_LABEL Provide application label of application under chaos Optional Default value is run=nginx run=nginx
APP_KIND Provide the kind of application Optional Default value is deployment Provide the kind of application Optional deployment
+ +### Pod Network Latency Experiment Variables + + - - + + + + + + + + + + + + + + - + - - - + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + +
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. Variables Description Specify In Chaos Action Default Value
EXPERIMENT_NAME For Running pod network latency experiment keep it pod-network-latency Mandatory No default value
NETWORK_INTERFACE Name of ethernet interface considered for shaping traffic Optional Default value is not set to true eth0
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos
NETWORK_LATENCY The latency/delay in milliseconds Optional Default value is not set to true 60000
CONTAINER_RUNTIME Give the target container runtime Optional containerd
SOCKET_PATH Socket path for the container runtime Optional /run/containerd/containerd.sock
TARGET_CONTAINER Name of container which is subjected to network latency Optional nginx
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional 120
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is litmuschaos/go-runner litmuschaos.docker.scarf.sh/litmuschaos/go-runner
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional Default value is latest 3.16.0
IMAGE_PULL_POLICY IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is Always
Always
PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional 0 (All pods)
TARGET_PODS Comma-separated list of specific pods to target Optional Not set
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Not set to true
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true diff --git a/experiments/pod-network-loss/README.md b/experiments/pod-network-loss/README.md index c68b159..042bf90 100644 --- a/experiments/pod-network-loss/README.md +++ b/experiments/pod-network-loss/README.md @@ -17,38 +17,244 @@ on: jobs: build: - runs-on: ubuntu-latest steps: - - name: Running pod-network-loss chaos experiment - uses: litmuschaos/github-chaos-actions@v0.4.0 - env: - KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} - ##If litmus is not installed - INSTALL_LITMUS: true - ##Give application info under chaos - APP_NS: default - APP_LABEL: run=nginx - APP_KIND: deployment - EXPERIMENT_NAME: pod-network-loss - ##Custom images can also be used - EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest - IMAGE_PULL_POLICY: Always - TARGET_CONTAINER: nginx - TOTAL_CHAOS_DURATION: 60 - NETWORK_INTERFACE: eth0 - NETWORK_PACKET_LOSS_PERCENTAGE: 100 - CONTAINER_RUNTIME: docker - ##Select true if you want to uninstall litmus after chaos - LITMUS_CLEANUP: true + - name: Running pod-network-loss chaos experiment + uses: litmuschaos/github-chaos-actions@v0.4.0 + env: + KUBE_CONFIG_DATA: ${{ secrets.KUBE_CONFIG_DATA }} + + # Litmus SDK Authentication + LITMUS_ENDPOINT: "https://chaos-center.example.com" + LITMUS_USERNAME: "admin" + LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} + LITMUS_PROJECT_ID: "your-project-id" + + # Infrastructure Setup + INSTALL_INFRA: "true" + INFRA_NAME: "pod-network-loss-infra" + INFRA_NAMESPACE: "litmus" + INFRA_SCOPE: "namespace" + + # Application Info + APP_NS: default + APP_LABEL: run=nginx + APP_KIND: deployment + + # Experiment Configuration + EXPERIMENT_NAME: pod-network-loss + EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 3.16.0 + IMAGE_PULL_POLICY: Always + + # Pod Network Loss Specific Configuration + TARGET_CONTAINER: nginx + TOTAL_CHAOS_DURATION: 60 + NETWORK_INTERFACE: eth0 + NETWORK_PACKET_LOSS_PERCENTAGE: 100 + CONTAINER_RUNTIME: containerd + SOCKET_PATH: /run/containerd/containerd.sock + PODS_AFFECTED_PERC: 100 + + # Optional Probe Setup + LITMUS_CREATE_PROBE: "true" + LITMUS_PROBE_NAME: "http-status-check" + LITMUS_PROBE_TYPE: "httpProbe" + LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_URL: "http://nginx-svc:80/" + LITMUS_PROBE_RESPONSE_CODE: "200" + + # Cleanup + LITMUS_CLEANUP: true ``` -## Environment Variabels +## Environment Variables + +The following environment variables are used to configure the pod-network-loss experiment. + +### SDK Authentication Variables (Required) -The application pod for pod-network-loss will be identified with the app info variables. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_ENDPOINT URL of the Litmus Chaos Center Mandatory No default value
LITMUS_USERNAME Username for Litmus authentication Mandatory No default value
LITMUS_PASSWORD Password for Litmus authentication Mandatory No default value
LITMUS_PROJECT_ID Project ID in Litmus Mandatory No default value
+ +### Infrastructure Setup Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
INSTALL_INFRA Whether to install infrastructure Optional true
USE_EXISTING_INFRA Whether to use existing infrastructure Optional false
EXISTING_INFRA_ID ID of existing infrastructure Required if USE_EXISTING_INFRA=true No default value
INFRA_NAME Name for the infrastructure Optional ci-infra-pod-network-loss
INFRA_NAMESPACE Kubernetes namespace for infrastructure Optional litmus
INFRA_SCOPE Scope of infrastructure Optional namespace
INFRA_SERVICE_ACCOUNT Service account for infrastructure Optional litmus
-**Supported Chaos Action Tunables** +### Probe Configuration Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
LITMUS_CREATE_PROBE Whether to create a probe Optional false
LITMUS_PROBE_NAME Name of the probe Optional http-probe
LITMUS_PROBE_TYPE Type of probe Optional httpProbe
LITMUS_PROBE_MODE Mode of the probe (SOT, EOT, Continuous) Optional SOT
LITMUS_PROBE_URL URL for HTTP probe Required for HTTP probe No default value
LITMUS_PROBE_TIMEOUT Timeout for probe Optional 30s
LITMUS_PROBE_INTERVAL Interval for probe Optional 10s
LITMUS_PROBE_ATTEMPTS Number of attempts for probe Optional 1
LITMUS_PROBE_RESPONSE_CODE Expected HTTP response code Optional 200
+ +### Application Info Variables + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
APP_NS Provide namespace of application under chaos Optional default
APP_LABEL Provide application label of application under chaos Optional run=nginx
APP_KIND Provide the kind of application Optional deployment
+ +### Pod Network Loss Experiment Variables @@ -67,78 +273,88 @@ The application pod for pod-network-loss will be identified with the app info va - + - + - + - + - + - + - - + + - - + + - + - - + + - + - - - - - + + + + + - - + + - + - - + + - + - - + + - + - - + + - - + + - - + + - - + +
NETWORK_INTERFACE Name of ethernet interface considered for shaping traffic Optional Default value is eth0 eth0
NETWORK_PACKET_LOSS_PERCENTAGE The packet loss in percentage. The packet loss in percentage Optional Default value is 100 100
TARGET_CONTAINER Name of container which is subjected to network loss. Name of container which is subjected to network loss Optional Default value is nginx nginx
TOTAL_CHAOS_DURATION The time duration for chaos injection (seconds) Optional Default value is 120s 120
CONTAINER_RUNTIME Give the target container runtime Optional Default value is 'docker'
containerd
APP_NS Provide namespace of application under chaos SOCKET_PATH Socket path for the container runtime Optional Default value is default /run/containerd/containerd.sock
APP_LABEL Provide application label of application under chaos. EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional Default value is run=nginx litmuschaos.docker.scarf.sh/litmuschaos/go-runner
APP_KIND Provide the kind of application Optional Default value is deployment
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional 3.16.0
INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed. IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment Optional Default value is not set to true Always
LITMUS_CLEANUP Keep it true to uninstall litmus after chaos PODS_AFFECTED_PERC Percentage of pods affected by chaos Optional Default value is not set to true 0 (All pods)
EXPERIMENT_IMAGE We can provide custom image for running chaos experiment TARGET_PODS Comma-separated list of specific pods to target Optional Default value is litmuschaos/go-runner Not set
EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment INSTALL_LITMUS Keep it true to install litmus if litmus is not already installed Optional Default value is latest
Not set to true
IMAGE_PULL_POLICY We can set the image pull policy while using custom image for running chaos experiment LITMUS_CLEANUP Keep it true to uninstall litmus after chaos Optional Default value is Always
Not set to true
+ +## Experiment Execution Process + +The experiment execution has evolved to use a more sophisticated SDK-based approach with these steps: +1. **Authentication & Setup**: Connect to Litmus Chaos Center using SDK credentials +2. **Infrastructure Provisioning**: Create or use existing chaos infrastructure +3. **Experiment Configuration**: Configure experiment parameters and probe settings +4. **Execution & Monitoring**: Run the experiment with unique ID and monitor progress +5. **Result Verification**: Verify results through detailed phase checking +6. **Optional Cleanup**: Remove chaos infrastructure if LITMUS_CLEANUP is set to true From bd10240a251f707cce9ed29b93dea2d4cc1848e9 Mon Sep 17 00:00:00 2001 From: Sky Singh Date: Mon, 19 May 2025 16:01:04 +0530 Subject: [PATCH 2/4] Update chaos experiment documentation to reflect changes in image references and tags. Standardized the EXPERIMENT_IMAGE and EXPERIMENT_IMAGE_TAG across multiple experiments to use 'litmuschaos/go-runner' with version '1.13.8'. Removed IMAGE_PULL_POLICY entries for clarity. Signed-off-by: Sky Singh --- README.md | 4 ++-- experiments/container-kill/README.md | 10 +++++----- experiments/disk-fill/README.md | 10 +++++----- experiments/node-cpu-hog/README.md | 10 +++++----- experiments/node-io-stress/README.md | 10 +++++----- experiments/node-memory-hog/README.md | 10 +++++----- experiments/pod-autoscaler/README.md | 10 +++++----- experiments/pod-cpu-hog/README.md | 10 +++++----- experiments/pod-delete/README.md | 10 +++++----- experiments/pod-memory-hog/README.md | 10 +++++----- experiments/pod-network-corruption/README.md | 10 +++++----- experiments/pod-network-duplication/README.md | 10 +++++----- experiments/pod-network-latency/README.md | 10 +++++----- experiments/pod-network-loss/README.md | 10 +++++----- 14 files changed, 67 insertions(+), 67 deletions(-) diff --git a/README.md b/README.md index f7523e8..307f648 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ jobs: APP_NS: default APP_LABEL: run=nginx APP_KIND: deployment - IMAGE_PULL_POLICY: Always + TOTAL_CHAOS_DURATION: 30 CHAOS_INTERVAL: 10 FORCE: false @@ -145,7 +145,7 @@ jobs: APP_NS: default APP_LABEL: run=nginx APP_KIND: deployment - IMAGE_PULL_POLICY: Always + TOTAL_CHAOS_DURATION: 30 CHAOS_INTERVAL: 10 FORCE: false diff --git a/experiments/container-kill/README.md b/experiments/container-kill/README.md index 53f751a..adb5fc3 100644 --- a/experiments/container-kill/README.md +++ b/experiments/container-kill/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: container-kill - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Container Kill Specific Configuration TARGET_CONTAINER: nginx @@ -305,13 +305,13 @@ The following environment variables are used to configure the container-kill exp EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/disk-fill/README.md b/experiments/disk-fill/README.md index 2c8d49b..e354c22 100644 --- a/experiments/disk-fill/README.md +++ b/experiments/disk-fill/README.md @@ -45,9 +45,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: disk-fill - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Disk Fill Specific Configuration FILL_PERCENTAGE: 80 @@ -303,13 +303,13 @@ The following environment variables are used to configure the disk-fill experime EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/node-cpu-hog/README.md b/experiments/node-cpu-hog/README.md index 3dddac9..f07ece5 100644 --- a/experiments/node-cpu-hog/README.md +++ b/experiments/node-cpu-hog/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: node-cpu-hog - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Node CPU Hog Specific Configuration TOTAL_CHAOS_DURATION: 60 @@ -294,13 +294,13 @@ The following environment variables are used to configure the node-cpu-hog exper EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/node-io-stress/README.md b/experiments/node-io-stress/README.md index 32e631e..7b18e4f 100644 --- a/experiments/node-io-stress/README.md +++ b/experiments/node-io-stress/README.md @@ -42,9 +42,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: node-io-stress - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Node IO Stress Specific Configuration TOTAL_CHAOS_DURATION: 120 @@ -293,13 +293,13 @@ The following environment variables are used to configure the node-io-stress exp EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/node-memory-hog/README.md b/experiments/node-memory-hog/README.md index 9f61653..f541f99 100644 --- a/experiments/node-memory-hog/README.md +++ b/experiments/node-memory-hog/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: node-memory-hog - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Node Memory Hog Specific Configuration TOTAL_CHAOS_DURATION: 120 @@ -294,13 +294,13 @@ The following environment variables are used to configure the node-memory-hog ex EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-autoscaler/README.md b/experiments/pod-autoscaler/README.md index 06d3d7b..d049169 100644 --- a/experiments/pod-autoscaler/README.md +++ b/experiments/pod-autoscaler/README.md @@ -41,9 +41,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-autoscaler - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod Autoscaler Specific Configuration TOTAL_CHAOS_DURATION: 60 @@ -299,13 +299,13 @@ The following environment variables are used to configure the pod-autoscaler exp EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-cpu-hog/README.md b/experiments/pod-cpu-hog/README.md index 9fc056c..71b2b1d 100644 --- a/experiments/pod-cpu-hog/README.md +++ b/experiments/pod-cpu-hog/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-cpu-hog - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod CPU Hog Specific Configuration TARGET_CONTAINER: nginx @@ -288,13 +288,13 @@ The following environment variables are used to configure the pod-cpu-hog experi EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-delete/README.md b/experiments/pod-delete/README.md index 681bb06..7b93869 100644 --- a/experiments/pod-delete/README.md +++ b/experiments/pod-delete/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-delete - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod Delete Specific Configuration TOTAL_CHAOS_DURATION: 30 @@ -288,13 +288,13 @@ The following environment variables are used to configure the pod-delete experim EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-memory-hog/README.md b/experiments/pod-memory-hog/README.md index 423ba80..8b66f7a 100644 --- a/experiments/pod-memory-hog/README.md +++ b/experiments/pod-memory-hog/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-memory-hog - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod Memory Hog Specific Configuration TARGET_CONTAINER: nginx @@ -288,13 +288,13 @@ The following environment variables are used to configure the pod-memory-hog exp EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-corruption/README.md b/experiments/pod-network-corruption/README.md index 066922f..56df8b2 100644 --- a/experiments/pod-network-corruption/README.md +++ b/experiments/pod-network-corruption/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-corruption - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod Network Corruption Specific Configuration TARGET_CONTAINER: nginx @@ -302,13 +302,13 @@ The following environment variables are used to configure the pod-network-corrup EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-duplication/README.md b/experiments/pod-network-duplication/README.md index 982f672..33ca3cf 100644 --- a/experiments/pod-network-duplication/README.md +++ b/experiments/pod-network-duplication/README.md @@ -41,9 +41,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-duplication - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod Network Duplication Specific Configuration TARGET_CONTAINER: nginx @@ -300,13 +300,13 @@ The following environment variables are used to configure the pod-network-duplic EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-latency/README.md b/experiments/pod-network-latency/README.md index b0367ff..1cd3db9 100644 --- a/experiments/pod-network-latency/README.md +++ b/experiments/pod-network-latency/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-latency - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod Network Latency Specific Configuration TARGET_CONTAINER: nginx @@ -309,13 +309,13 @@ The following environment variables are used to configure the pod-network-latenc EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-loss/README.md b/experiments/pod-network-loss/README.md index 042bf90..00a4352 100644 --- a/experiments/pod-network-loss/README.md +++ b/experiments/pod-network-loss/README.md @@ -43,9 +43,9 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-loss - EXPERIMENT_IMAGE: litmuschaos.docker.scarf.sh/litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 3.16.0 - IMAGE_PULL_POLICY: Always + EXPERIMENT_IMAGE: litmuschaos/go-runner + EXPERIMENT_IMAGE_TAG: 1.13.8 + # Pod Network Loss Specific Configuration TARGET_CONTAINER: nginx @@ -309,13 +309,13 @@ The following environment variables are used to configure the pod-network-loss e EXPERIMENT_IMAGE We can provide custom image for running chaos experiment Optional - litmuschaos.docker.scarf.sh/litmuschaos/go-runner + litmuschaos/go-runner EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 3.16.0 + 1.13.8 IMAGE_PULL_POLICY From f42cea93dfaa41e544945263874af732b1bd66b1 Mon Sep 17 00:00:00 2001 From: Sky Singh Date: Wed, 28 May 2025 19:16:28 +0530 Subject: [PATCH 3/4] Update Dockerfile and entrypoint.sh for chaos experiments. Changed base image to 'litmuschaos/chaos-ci-lib:v0.5.0', standardized EXPERIMENT_IMAGE_TAG to '3.18.0', and improved experiment configuration by setting default values and cleanup options. Updated README files across multiple experiments to reflect these changes. Signed-off-by: Sky Singh --- Dockerfile | 29 +---- README.md | 6 +- entrypoint.sh | 100 ++++++++++++------ experiments/container-kill/README.md | 8 +- experiments/disk-fill/README.md | 6 +- experiments/node-cpu-hog/README.md | 6 +- experiments/node-io-stress/README.md | 6 +- experiments/node-memory-hog/README.md | 6 +- experiments/pod-autoscaler/README.md | 6 +- experiments/pod-cpu-hog/README.md | 8 +- experiments/pod-delete/README.md | 8 +- experiments/pod-memory-hog/README.md | 8 +- experiments/pod-network-corruption/README.md | 8 +- experiments/pod-network-duplication/README.md | 8 +- experiments/pod-network-latency/README.md | 8 +- experiments/pod-network-loss/README.md | 8 +- 16 files changed, 120 insertions(+), 109 deletions(-) diff --git a/Dockerfile b/Dockerfile index 165010d..cf43d79 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:latest +FROM litmuschaos/chaos-ci-lib:v0.5.0 LABEL name="Kubernetes Chaos" LABEL repository="http://github.com/litmuschaos/github-chaos-actions" @@ -10,33 +10,6 @@ LABEL com.github.actions.description="Different Chaos Experiment for Kubernetes" LABEL com.github.actions.icon="terminal" LABEL com.github.actions.color="blue" -ENV GOPATH=/github/home/go -ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin -ARG HELM_VERSION=3.2.3 -ARG RELEASE_ROOT="https://get.helm.sh" -ARG RELEASE_FILE="helm-v${HELM_VERSION}-linux-amd64.tar.gz" - -ARG KUBECTL_VERSION=1.22.0 -ADD https://storage.googleapis.com/kubernetes-release/release/v${KUBECTL_VERSION}/bin/linux/amd64/kubectl /usr/local/bin/kubectl -RUN chmod +x /usr/local/bin/kubectl - -RUN apt-get update && apt-get install -y git \ - curl \ - unzip \ - python3-pip \ - && apt-get clean - -RUN apt-get update && \ - curl -L ${RELEASE_ROOT}/${RELEASE_FILE} |tar xvz && \ - mv linux-amd64/helm /usr/bin/helm && \ - chmod +x /usr/bin/helm - -RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ - unzip awscliv2.zip && \ - ./aws/install - -RUN pip install oci-cli - COPY README.md / COPY entrypoint.sh /entrypoint.sh COPY experiments ./experiments diff --git a/README.md b/README.md index 307f648..e5cdae1 100644 --- a/README.md +++ b/README.md @@ -80,7 +80,7 @@ jobs: env: EXPERIMENT_NAME: pod-delete EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest + EXPERIMENT_IMAGE_TAG: 3.18.0 JOB_CLEANUP_POLICY: delete APP_NS: default APP_LABEL: run=nginx @@ -140,7 +140,7 @@ jobs: env: EXPERIMENT_NAME: pod-delete EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: latest + EXPERIMENT_IMAGE_TAG: 3.18.0 JOB_CLEANUP_POLICY: delete APP_NS: default APP_LABEL: run=nginx @@ -224,7 +224,7 @@ Some comman environment variables used for running the `github-chaos-actions` ar EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - Default value is latest + Default value is 3.18.0 IMAGE_PULL_POLICY diff --git a/entrypoint.sh b/entrypoint.sh index 80eff50..eca28bf 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,10 +2,6 @@ set -e -TOTAL_CHAOS_DURATION=${TOTAL_CHAOS_DURATION:=60} -TEST_TIMEOUT=$((600 + $TOTAL_CHAOS_DURATION)) -PARALLEL_EXECUTION=${PARALLEL_EXECUTION:=1} - ##Extract the base64 encoded config data and write this to the KUBECONFIG if [ ! -z "$KUBE_CONFIG_DATA" ] then @@ -14,11 +10,7 @@ then export KUBECONFIG=${HOME}/.kube/config fi -##Setup -mkdir -p $HOME/go/src/github.com/litmuschaos -cd ${GOPATH}/src/github.com/litmuschaos/ -dir=${GOPATH}/src/github.com/litmuschaos/chaos-ci-lib - +##Setup AWS credentials if provided if [[ ! -z $AWS_ACCESS_KEY_ID ]] && [[ ! -z $AWS_SECRET_ACCESS_KEY ]] && [[ ! -z $AWS_DEFAULT_REGION ]] then aws configure set default.region ${AWS_DEFAULT_REGION} @@ -26,31 +18,77 @@ then aws configure set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY} fi -if [ ! -d $dir ] -then - git clone https://github.com/litmuschaos/chaos-ci-lib.git -fi -cd chaos-ci-lib +# Set default values for experiment configuration +EXPERIMENT_IMAGE=${EXPERIMENT_IMAGE:-"litmuschaos/go-runner"} +EXPERIMENT_IMAGE_TAG=${EXPERIMENT_IMAGE_TAG:-"3.18.0"} +TOTAL_CHAOS_DURATION=${TOTAL_CHAOS_DURATION:-60} -##Install litmus if it is not already installed -if [ "$INSTALL_LITMUS" == "true" ] -then - go test litmus/install-litmus_test.go -v -count=1 +# Handle Litmus installation if requested +if [ "$INSTALL_LITMUS" = "true" ]; then + echo "Installing Litmus..." + /app/install-litmus fi -if [ "$EXPERIMENT_NAME" == "all" ]; then -## Run all BDDs - cd experiments - ginkgo -nodes=${PARALLEL_EXECUTION} - cd .. - -elif [ ! -z "$EXPERIMENT_NAME" ]; then -## Run the selected chaos experiment - go test experiments/${EXPERIMENT_NAME}_test.go -v -count=1 -timeout=${TEST_TIMEOUT}s +# Handle Litmus cleanup if requested and no experiment is specified +if [ "$LITMUS_CLEANUP" = "true" ] && [ -z "$EXPERIMENT_NAME" ]; then + echo "Cleaning up Litmus..." + /app/uninstall-litmus + exit 0 fi -##litmus cleanup -if [ "$LITMUS_CLEANUP" == "true" ] -then - go test litmus/uninstall-litmus_test.go -v -count=1 +# Map experiment names to their corresponding scripts in chaos-ci-lib +case "$EXPERIMENT_NAME" in + "pod-delete") + /app/pod-delete + ;; + "container-kill") + /app/container-kill + ;; + "pod-cpu-hog") + /app/pod-cpu-hog + ;; + "pod-memory-hog") + /app/pod-memory-hog + ;; + "node-cpu-hog") + /app/node-cpu-hog + ;; + "node-memory-hog") + /app/node-memory-hog + ;; + "node-io-stress") + /app/node-io-stress + ;; + "disk-fill") + /app/disk-fill + ;; + "pod-network-latency") + /app/pod-network-latency + ;; + "pod-network-loss") + /app/pod-network-loss + ;; + "pod-network-corruption") + /app/pod-network-corruption + ;; + "pod-network-duplication") + /app/pod-network-duplication + ;; + "pod-autoscaler") + /app/pod-autoscaler + ;; + "all") + /app/all-experiments + ;; + *) + echo "Unknown experiment: $EXPERIMENT_NAME" + echo "Available experiments: pod-delete, container-kill, pod-cpu-hog, pod-memory-hog, node-cpu-hog, node-memory-hog, node-io-stress, disk-fill, pod-network-latency, pod-network-loss, pod-network-corruption, pod-network-duplication, pod-autoscaler, all" + exit 1 + ;; +esac + +# Handle Litmus cleanup after experiment if requested +if [ "$LITMUS_CLEANUP" = "true" ] && [ ! -z "$EXPERIMENT_NAME" ]; then + echo "Cleaning up Litmus after experiment..." + /app/uninstall-litmus fi diff --git a/experiments/container-kill/README.md b/experiments/container-kill/README.md index adb5fc3..e4ba235 100644 --- a/experiments/container-kill/README.md +++ b/experiments/container-kill/README.md @@ -44,7 +44,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: container-kill EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Container Kill Specific Configuration @@ -55,14 +55,14 @@ jobs: SOCKET_PATH: /run/containerd/containerd.sock SIGNAL: SIGKILL SEQUENCE: parallel - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 DEFAULT_HEALTH_CHECK: false # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -311,7 +311,7 @@ The following environment variables are used to configure the container-kill exp EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/disk-fill/README.md b/experiments/disk-fill/README.md index e354c22..c7436ed 100644 --- a/experiments/disk-fill/README.md +++ b/experiments/disk-fill/README.md @@ -46,7 +46,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: disk-fill EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Disk Fill Specific Configuration @@ -60,7 +60,7 @@ jobs: LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -309,7 +309,7 @@ The following environment variables are used to configure the disk-fill experime EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/node-cpu-hog/README.md b/experiments/node-cpu-hog/README.md index f07ece5..41e9a28 100644 --- a/experiments/node-cpu-hog/README.md +++ b/experiments/node-cpu-hog/README.md @@ -44,7 +44,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: node-cpu-hog EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Node CPU Hog Specific Configuration @@ -57,7 +57,7 @@ jobs: LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -300,7 +300,7 @@ The following environment variables are used to configure the node-cpu-hog exper EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/node-io-stress/README.md b/experiments/node-io-stress/README.md index 7b18e4f..16e5849 100644 --- a/experiments/node-io-stress/README.md +++ b/experiments/node-io-stress/README.md @@ -43,7 +43,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: node-io-stress EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Node IO Stress Specific Configuration @@ -56,7 +56,7 @@ jobs: LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -299,7 +299,7 @@ The following environment variables are used to configure the node-io-stress exp EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/node-memory-hog/README.md b/experiments/node-memory-hog/README.md index f541f99..216d50b 100644 --- a/experiments/node-memory-hog/README.md +++ b/experiments/node-memory-hog/README.md @@ -44,7 +44,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: node-memory-hog EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Node Memory Hog Specific Configuration @@ -57,7 +57,7 @@ jobs: LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -300,7 +300,7 @@ The following environment variables are used to configure the node-memory-hog ex EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-autoscaler/README.md b/experiments/pod-autoscaler/README.md index d049169..2d642b3 100644 --- a/experiments/pod-autoscaler/README.md +++ b/experiments/pod-autoscaler/README.md @@ -42,7 +42,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-autoscaler EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod Autoscaler Specific Configuration @@ -56,7 +56,7 @@ jobs: LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -305,7 +305,7 @@ The following environment variables are used to configure the pod-autoscaler exp EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-cpu-hog/README.md b/experiments/pod-cpu-hog/README.md index 71b2b1d..bc4a35f 100644 --- a/experiments/pod-cpu-hog/README.md +++ b/experiments/pod-cpu-hog/README.md @@ -44,20 +44,20 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-cpu-hog EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod CPU Hog Specific Configuration TARGET_CONTAINER: nginx TOTAL_CHAOS_DURATION: 60 CPU_CORES: 1 - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -294,7 +294,7 @@ The following environment variables are used to configure the pod-cpu-hog experi EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-delete/README.md b/experiments/pod-delete/README.md index 7b93869..99a9f14 100644 --- a/experiments/pod-delete/README.md +++ b/experiments/pod-delete/README.md @@ -44,20 +44,20 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-delete EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod Delete Specific Configuration TOTAL_CHAOS_DURATION: 30 CHAOS_INTERVAL: 10 FORCE: false - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -294,7 +294,7 @@ The following environment variables are used to configure the pod-delete experim EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-memory-hog/README.md b/experiments/pod-memory-hog/README.md index 8b66f7a..0e44d2c 100644 --- a/experiments/pod-memory-hog/README.md +++ b/experiments/pod-memory-hog/README.md @@ -44,20 +44,20 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-memory-hog EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod Memory Hog Specific Configuration TARGET_CONTAINER: nginx TOTAL_CHAOS_DURATION: 60 MEMORY_CONSUMPTION: 500 - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -294,7 +294,7 @@ The following environment variables are used to configure the pod-memory-hog exp EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-corruption/README.md b/experiments/pod-network-corruption/README.md index 56df8b2..d9fadef 100644 --- a/experiments/pod-network-corruption/README.md +++ b/experiments/pod-network-corruption/README.md @@ -44,7 +44,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-corruption EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod Network Corruption Specific Configuration @@ -53,13 +53,13 @@ jobs: NETWORK_INTERFACE: eth0 CONTAINER_RUNTIME: containerd SOCKET_PATH: /run/containerd/containerd.sock - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -308,7 +308,7 @@ The following environment variables are used to configure the pod-network-corrup EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-duplication/README.md b/experiments/pod-network-duplication/README.md index 33ca3cf..bbd2c23 100644 --- a/experiments/pod-network-duplication/README.md +++ b/experiments/pod-network-duplication/README.md @@ -42,7 +42,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-duplication EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod Network Duplication Specific Configuration @@ -51,13 +51,13 @@ jobs: NETWORK_INTERFACE: eth0 CONTAINER_RUNTIME: containerd SOCKET_PATH: /run/containerd/containerd.sock - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -306,7 +306,7 @@ The following environment variables are used to configure the pod-network-duplic EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-latency/README.md b/experiments/pod-network-latency/README.md index 1cd3db9..c06c709 100644 --- a/experiments/pod-network-latency/README.md +++ b/experiments/pod-network-latency/README.md @@ -44,7 +44,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-latency EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod Network Latency Specific Configuration @@ -54,13 +54,13 @@ jobs: NETWORK_LATENCY: 60000 CONTAINER_RUNTIME: containerd SOCKET_PATH: /run/containerd/containerd.sock - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -315,7 +315,7 @@ The following environment variables are used to configure the pod-network-latenc EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY diff --git a/experiments/pod-network-loss/README.md b/experiments/pod-network-loss/README.md index 00a4352..7df88f8 100644 --- a/experiments/pod-network-loss/README.md +++ b/experiments/pod-network-loss/README.md @@ -44,7 +44,7 @@ jobs: # Experiment Configuration EXPERIMENT_NAME: pod-network-loss EXPERIMENT_IMAGE: litmuschaos/go-runner - EXPERIMENT_IMAGE_TAG: 1.13.8 + EXPERIMENT_IMAGE_TAG: 3.18.0 # Pod Network Loss Specific Configuration @@ -54,13 +54,13 @@ jobs: NETWORK_PACKET_LOSS_PERCENTAGE: 100 CONTAINER_RUNTIME: containerd SOCKET_PATH: /run/containerd/containerd.sock - PODS_AFFECTED_PERC: 100 + PODS_AFFECTED_PERC: 0 # Optional Probe Setup LITMUS_CREATE_PROBE: "true" LITMUS_PROBE_NAME: "http-status-check" LITMUS_PROBE_TYPE: "httpProbe" - LITMUS_PROBE_MODE: "Continuous" + LITMUS_PROBE_MODE: "SOT" LITMUS_PROBE_URL: "http://nginx-svc:80/" LITMUS_PROBE_RESPONSE_CODE: "200" @@ -315,7 +315,7 @@ The following environment variables are used to configure the pod-network-loss e EXPERIMENT_IMAGE_TAG We can set the image tag while using custom image for the chaos experiment Optional - 1.13.8 + 3.18.0 IMAGE_PULL_POLICY From e4d784980bc57346288c03e77e8566e80c7f53aa Mon Sep 17 00:00:00 2001 From: Sky Singh Date: Sat, 31 May 2025 00:17:31 +0530 Subject: [PATCH 4/4] Enhance entrypoint.sh and experiment documentation with comprehensive environment variable configurations. Added default values for chaos experiments, including SDK authentication and probe settings. Updated README files for multiple experiments to reflect changes in infrastructure scope from 'namespace' to 'cluster' and standardized common environment variables for clarity. Signed-off-by: Sky Singh --- entrypoint.sh | 119 ++++++++++++++++-- experiments/container-kill/README.md | 69 +++++++++- experiments/disk-fill/README.md | 65 ++++++++++ experiments/node-cpu-hog/README.md | 69 +++++++++- experiments/node-io-stress/README.md | 69 +++++++++- experiments/node-memory-hog/README.md | 69 +++++++++- experiments/pod-autoscaler/README.md | 65 ++++++++++ experiments/pod-cpu-hog/README.md | 65 ++++++++++ experiments/pod-delete/README.md | 65 ++++++++++ experiments/pod-memory-hog/README.md | 65 ++++++++++ experiments/pod-network-corruption/README.md | 84 ++++++++++++- experiments/pod-network-duplication/README.md | 65 ++++++++++ experiments/pod-network-latency/README.md | 96 +++++++++++--- experiments/pod-network-loss/README.md | 96 +++++++++++--- 14 files changed, 1001 insertions(+), 60 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index eca28bf..11c700c 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,50 @@ set -e +# ============================================================================== +# Litmus Chaos GitHub Action Environment Variables +# ============================================================================== +# The following environment variables can be set to customize chaos experiments: +# +# REQUIRED SDK Authentication Variables: +# LITMUS_ENDPOINT - URL of Litmus Chaos Center (default: http://localhost:9091) +# LITMUS_USERNAME - Username for authentication (default: admin) +# LITMUS_PASSWORD - Password for authentication (default: litmus) +# LITMUS_PROJECT_ID - Project ID in Litmus (default: admin-project) +# +# Common Environment Variables: +# KUBECONFIG - Path to kubeconfig file (default: /home/runner/.kube/config) +# APP_NS - Application namespace (default: litmus) +# INSTALL_INFRA - Whether to install infrastructure (default: true) +# ACTIVATE_INFRA - Whether to activate infrastructure (default: true) +# CREATE_ENV - Whether to create environment (default: true) +# ENV_NAME - Environment name (default: ci-test-env) +# ENV_TYPE - Environment type (default: NON_PROD) +# INFRA_NAMESPACE - Infrastructure namespace (default: litmus) +# INFRA_ACTIVATION_TIMEOUT - Timeout for infrastructure activation (default: 5) +# +# Probe Configuration: +# LITMUS_CREATE_PROBE - Create probe (default: true) +# LITMUS_USE_EXISTING_PROBE - Use existing probe (default: false) +# LITMUS_PROBE_TYPE - Probe type (default: httpProbe) +# LITMUS_PROBE_MODE - Probe mode (default: SOT) +# LITMUS_PROBE_TIMEOUT - Probe timeout (default: 30s) +# LITMUS_PROBE_INTERVAL - Probe interval (default: 10s) +# LITMUS_PROBE_ATTEMPTS - Probe attempts (default: 1) +# LITMUS_PROBE_RESPONSE_CODE - Expected response code (default: 200) +# +# Experiment-Specific Variables (auto-set based on EXPERIMENT_NAME): +# APP_LABEL - Application label for targeting +# INFRA_NAME - Infrastructure name +# INFRA_SCOPE - Infrastructure scope (cluster/namespace) +# LITMUS_PROBE_NAME - Probe name +# LITMUS_PROBE_URL - Probe URL +# +# Special Variables for container-kill experiment: +# SOCKET_PATH - Container runtime socket path +# CONTAINER_RUNTIME - Container runtime type +# ============================================================================== + ##Extract the base64 encoded config data and write this to the KUBECONFIG if [ ! -z "$KUBE_CONFIG_DATA" ] then @@ -18,24 +62,73 @@ then aws configure set aws_secret_access_key ${AWS_SECRET_ACCESS_KEY} fi +# Set default values for common environment variables +export KUBECONFIG=${KUBECONFIG:-"/home/runner/.kube/config"} +export LITMUS_ENDPOINT=${LITMUS_ENDPOINT:-"http://localhost:9091"} +export LITMUS_USERNAME=${LITMUS_USERNAME:-"admin"} +export LITMUS_PASSWORD=${LITMUS_PASSWORD:-"litmus"} +export LITMUS_PROJECT_ID=${LITMUS_PROJECT_ID:-"admin-project"} + +# Application and Infrastructure Setup +export APP_NS=${APP_NS:-"litmus"} +export INSTALL_INFRA=${INSTALL_INFRA:-"true"} +export ACTIVATE_INFRA=${ACTIVATE_INFRA:-"true"} +export CREATE_ENV=${CREATE_ENV:-"true"} +export ENV_NAME=${ENV_NAME:-"ci-test-env"} +export ENV_TYPE=${ENV_TYPE:-"NON_PROD"} +export INFRA_NAMESPACE=${INFRA_NAMESPACE:-"litmus"} +export INFRA_ACTIVATION_TIMEOUT=${INFRA_ACTIVATION_TIMEOUT:-"5"} + +# Probe Configuration +export LITMUS_CREATE_PROBE=${LITMUS_CREATE_PROBE:-"true"} +export LITMUS_USE_EXISTING_PROBE=${LITMUS_USE_EXISTING_PROBE:-"false"} +export LITMUS_PROBE_TYPE=${LITMUS_PROBE_TYPE:-"httpProbe"} +export LITMUS_PROBE_MODE=${LITMUS_PROBE_MODE:-"SOT"} +export LITMUS_PROBE_TIMEOUT=${LITMUS_PROBE_TIMEOUT:-"30s"} +export LITMUS_PROBE_INTERVAL=${LITMUS_PROBE_INTERVAL:-"10s"} +export LITMUS_PROBE_ATTEMPTS=${LITMUS_PROBE_ATTEMPTS:-"1"} +export LITMUS_PROBE_RESPONSE_CODE=${LITMUS_PROBE_RESPONSE_CODE:-"200"} + +# Set experiment-specific defaults based on experiment name +case "$EXPERIMENT_NAME" in + "container-kill") + export APP_LABEL=${APP_LABEL:-"app=nginx-container-kill"} + export INFRA_NAME=${INFRA_NAME:-"ci-infra-container-kill"} + export INFRA_SCOPE=${INFRA_SCOPE:-"cluster"} + export LITMUS_PROBE_NAME=${LITMUS_PROBE_NAME:-"ci-http-probe-container-kill"} + export LITMUS_PROBE_URL=${LITMUS_PROBE_URL:-"http://nginx-service-container-kill.litmus.svc.cluster.local:80"} + export SOCKET_PATH=${SOCKET_PATH:-"/run/containerd/containerd.sock"} + export CONTAINER_RUNTIME=${CONTAINER_RUNTIME:-"containerd"} + ;; + "node-cpu-hog"|"node-memory-hog"|"node-io-stress") + export APP_LABEL=${APP_LABEL:-"app=nginx-${EXPERIMENT_NAME}"} + export INFRA_NAME=${INFRA_NAME:-"ci-infra-${EXPERIMENT_NAME}"} + export INFRA_SCOPE=${INFRA_SCOPE:-"cluster"} + export LITMUS_PROBE_NAME=${LITMUS_PROBE_NAME:-"ci-http-probe-${EXPERIMENT_NAME}"} + export LITMUS_PROBE_URL=${LITMUS_PROBE_URL:-"http://nginx-service-${EXPERIMENT_NAME}.litmus.svc.cluster.local:80"} + ;; + "disk-fill"|"pod-autoscaler"|"pod-cpu-hog"|"pod-delete"|"pod-memory-hog"|"pod-network-corruption"|"pod-network-duplication"|"pod-network-latency"|"pod-network-loss") + export APP_LABEL=${APP_LABEL:-"app=nginx-${EXPERIMENT_NAME}"} + export INFRA_NAME=${INFRA_NAME:-"ci-infra-${EXPERIMENT_NAME}"} + export INFRA_SCOPE=${INFRA_SCOPE:-"namespace"} + export LITMUS_PROBE_NAME=${LITMUS_PROBE_NAME:-"ci-http-probe-${EXPERIMENT_NAME}"} + export LITMUS_PROBE_URL=${LITMUS_PROBE_URL:-"http://nginx-service-${EXPERIMENT_NAME}.litmus.svc.cluster.local:80"} + ;; + *) + # Default values for unspecified experiments + export APP_LABEL=${APP_LABEL:-"app=nginx"} + export INFRA_NAME=${INFRA_NAME:-"ci-infra-default"} + export INFRA_SCOPE=${INFRA_SCOPE:-"namespace"} + export LITMUS_PROBE_NAME=${LITMUS_PROBE_NAME:-"ci-http-probe-default"} + export LITMUS_PROBE_URL=${LITMUS_PROBE_URL:-"http://nginx-service.litmus.svc.cluster.local:80"} + ;; +esac + # Set default values for experiment configuration EXPERIMENT_IMAGE=${EXPERIMENT_IMAGE:-"litmuschaos/go-runner"} EXPERIMENT_IMAGE_TAG=${EXPERIMENT_IMAGE_TAG:-"3.18.0"} TOTAL_CHAOS_DURATION=${TOTAL_CHAOS_DURATION:-60} -# Handle Litmus installation if requested -if [ "$INSTALL_LITMUS" = "true" ]; then - echo "Installing Litmus..." - /app/install-litmus -fi - -# Handle Litmus cleanup if requested and no experiment is specified -if [ "$LITMUS_CLEANUP" = "true" ] && [ -z "$EXPERIMENT_NAME" ]; then - echo "Cleaning up Litmus..." - /app/uninstall-litmus - exit 0 -fi - # Map experiment names to their corresponding scripts in chaos-ci-lib case "$EXPERIMENT_NAME" in "pod-delete") diff --git a/experiments/container-kill/README.md b/experiments/container-kill/README.md index e4ba235..80815a2 100644 --- a/experiments/container-kill/README.md +++ b/experiments/container-kill/README.md @@ -34,7 +34,7 @@ jobs: INSTALL_INFRA: "true" INFRA_NAME: "container-kill-infra" INFRA_NAMESPACE: "litmus" - INFRA_SCOPE: "namespace" + INFRA_SCOPE: "cluster" # Application Info APP_NS: default @@ -109,6 +109,71 @@ The following environment variables are used to configure the container-kill exp +### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-container-kill
+ ### Infrastructure Setup Variables @@ -152,7 +217,7 @@ The following environment variables are used to configure the container-kill exp - + diff --git a/experiments/disk-fill/README.md b/experiments/disk-fill/README.md index c7436ed..2cacb49 100644 --- a/experiments/disk-fill/README.md +++ b/experiments/disk-fill/README.md @@ -107,6 +107,71 @@ The following environment variables are used to configure the disk-fill experime
INFRA_SCOPE Scope of infrastructure Optional namespace cluster
INFRA_SERVICE_ACCOUNT
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-disk-fill
+ ### Infrastructure Setup Variables diff --git a/experiments/node-cpu-hog/README.md b/experiments/node-cpu-hog/README.md index 41e9a28..16ad8b9 100644 --- a/experiments/node-cpu-hog/README.md +++ b/experiments/node-cpu-hog/README.md @@ -34,7 +34,7 @@ jobs: INSTALL_INFRA: "true" INFRA_NAME: "node-cpu-hog-infra" INFRA_NAMESPACE: "litmus" - INFRA_SCOPE: "namespace" + INFRA_SCOPE: "cluster" # Application Info APP_NS: default @@ -104,6 +104,71 @@ The following environment variables are used to configure the node-cpu-hog exper
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-node-cpu-hog
+ ### Infrastructure Setup Variables @@ -147,7 +212,7 @@ The following environment variables are used to configure the node-cpu-hog exper - + diff --git a/experiments/node-io-stress/README.md b/experiments/node-io-stress/README.md index 16e5849..340d51b 100644 --- a/experiments/node-io-stress/README.md +++ b/experiments/node-io-stress/README.md @@ -33,7 +33,7 @@ jobs: INSTALL_INFRA: "true" INFRA_NAME: "node-io-stress-infra" INFRA_NAMESPACE: "litmus" - INFRA_SCOPE: "namespace" + INFRA_SCOPE: "cluster" # Application Info APP_NS: default @@ -103,6 +103,71 @@ The following environment variables are used to configure the node-io-stress exp
INFRA_SCOPE Scope of infrastructure Optional namespace cluster
INFRA_SERVICE_ACCOUNT
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-node-io-stress
+ ### Infrastructure Setup Variables @@ -146,7 +211,7 @@ The following environment variables are used to configure the node-io-stress exp - + diff --git a/experiments/node-memory-hog/README.md b/experiments/node-memory-hog/README.md index 216d50b..385c0ba 100644 --- a/experiments/node-memory-hog/README.md +++ b/experiments/node-memory-hog/README.md @@ -34,7 +34,7 @@ jobs: INSTALL_INFRA: "true" INFRA_NAME: "node-memory-hog-infra" INFRA_NAMESPACE: "litmus" - INFRA_SCOPE: "namespace" + INFRA_SCOPE: "cluster" # Application Info APP_NS: default @@ -104,6 +104,71 @@ The following environment variables are used to configure the node-memory-hog ex
INFRA_SCOPE Scope of infrastructure Optional namespace cluster
INFRA_SERVICE_ACCOUNT
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-node-memory-hog
+ ### Infrastructure Setup Variables @@ -147,7 +212,7 @@ The following environment variables are used to configure the node-memory-hog ex - + diff --git a/experiments/pod-autoscaler/README.md b/experiments/pod-autoscaler/README.md index 2d642b3..407e532 100644 --- a/experiments/pod-autoscaler/README.md +++ b/experiments/pod-autoscaler/README.md @@ -103,6 +103,71 @@ The following environment variables are used to configure the pod-autoscaler exp
INFRA_SCOPE Scope of infrastructure Optional namespace cluster
INFRA_SERVICE_ACCOUNT
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-autoscaler
+ ### Infrastructure Setup Variables diff --git a/experiments/pod-cpu-hog/README.md b/experiments/pod-cpu-hog/README.md index bc4a35f..6c48f70 100644 --- a/experiments/pod-cpu-hog/README.md +++ b/experiments/pod-cpu-hog/README.md @@ -104,6 +104,71 @@ The following environment variables are used to configure the pod-cpu-hog experi
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-cpu-hog
+ ### Infrastructure Setup Variables diff --git a/experiments/pod-delete/README.md b/experiments/pod-delete/README.md index 99a9f14..45aed64 100644 --- a/experiments/pod-delete/README.md +++ b/experiments/pod-delete/README.md @@ -104,6 +104,71 @@ The following environment variables are used to configure the pod-delete experim
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-delete
+ ### Infrastructure Setup Variables diff --git a/experiments/pod-memory-hog/README.md b/experiments/pod-memory-hog/README.md index 0e44d2c..3ce4e8e 100644 --- a/experiments/pod-memory-hog/README.md +++ b/experiments/pod-memory-hog/README.md @@ -104,6 +104,71 @@ The following environment variables are used to configure the pod-memory-hog exp
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-memory-hog
+ ### Infrastructure Setup Variables diff --git a/experiments/pod-network-corruption/README.md b/experiments/pod-network-corruption/README.md index d9fadef..049504d 100644 --- a/experiments/pod-network-corruption/README.md +++ b/experiments/pod-network-corruption/README.md @@ -30,15 +30,24 @@ jobs: LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} LITMUS_PROJECT_ID: "your-project-id" + # Common Environment Variables + KUBECONFIG: /home/runner/.kube/config + APP_NS: litmus + ACTIVATE_INFRA: true + CREATE_ENV: true + ENV_NAME: ci-test-env + ENV_TYPE: NON_PROD + INFRA_ACTIVATION_TIMEOUT: 5 + LITMUS_USE_EXISTING_PROBE: false + APP_LABEL: app=nginx-pod-network-corruption + # Infrastructure Setup INSTALL_INFRA: "true" - INFRA_NAME: "pod-network-corruption-infra" - INFRA_NAMESPACE: "litmus" - INFRA_SCOPE: "namespace" + INFRA_NAME: pod-network-corruption-infra + INFRA_NAMESPACE: litmus + INFRA_SCOPE: namespace # Application Info - APP_NS: default - APP_LABEL: run=nginx APP_KIND: deployment # Experiment Configuration @@ -106,6 +115,71 @@ The following environment variables are used to configure the pod-network-corrup
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-network-corruption
+ ### Infrastructure Setup Variables diff --git a/experiments/pod-network-duplication/README.md b/experiments/pod-network-duplication/README.md index bbd2c23..8f6d3d9 100644 --- a/experiments/pod-network-duplication/README.md +++ b/experiments/pod-network-duplication/README.md @@ -104,6 +104,71 @@ The following environment variables are used to configure the pod-network-duplic
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-network-duplication
+ ### Infrastructure Setup Variables diff --git a/experiments/pod-network-latency/README.md b/experiments/pod-network-latency/README.md index c06c709..c7052dd 100644 --- a/experiments/pod-network-latency/README.md +++ b/experiments/pod-network-latency/README.md @@ -30,15 +30,24 @@ jobs: LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} LITMUS_PROJECT_ID: "your-project-id" + # Common Environment Variables + KUBECONFIG: /home/runner/.kube/config + APP_NS: litmus + ACTIVATE_INFRA: true + CREATE_ENV: true + ENV_NAME: ci-test-env + ENV_TYPE: NON_PROD + INFRA_ACTIVATION_TIMEOUT: 5 + LITMUS_USE_EXISTING_PROBE: false + APP_LABEL: app=nginx-pod-network-latency + # Infrastructure Setup INSTALL_INFRA: "true" - INFRA_NAME: "pod-network-latency-infra" - INFRA_NAMESPACE: "litmus" - INFRA_SCOPE: "namespace" + INFRA_NAME: pod-network-latency-infra + INFRA_NAMESPACE: litmus + INFRA_SCOPE: namespace # Application Info - APP_NS: default - APP_LABEL: run=nginx APP_KIND: deployment # Experiment Configuration @@ -107,6 +116,71 @@ The following environment variables are used to configure the pod-network-latenc
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-network-latency
+ ### Infrastructure Setup Variables @@ -235,18 +309,6 @@ The following environment variables are used to configure the pod-network-latenc - - - - - - - - - - - - diff --git a/experiments/pod-network-loss/README.md b/experiments/pod-network-loss/README.md index 7df88f8..d2f5a39 100644 --- a/experiments/pod-network-loss/README.md +++ b/experiments/pod-network-loss/README.md @@ -30,15 +30,24 @@ jobs: LITMUS_PASSWORD: ${{ secrets.LITMUS_PASSWORD }} LITMUS_PROJECT_ID: "your-project-id" + # Common Environment Variables + KUBECONFIG: /home/runner/.kube/config + APP_NS: litmus + ACTIVATE_INFRA: true + CREATE_ENV: true + ENV_NAME: ci-test-env + ENV_TYPE: NON_PROD + INFRA_ACTIVATION_TIMEOUT: 5 + LITMUS_USE_EXISTING_PROBE: false + APP_LABEL: app=nginx-pod-network-loss + # Infrastructure Setup INSTALL_INFRA: "true" - INFRA_NAME: "pod-network-loss-infra" - INFRA_NAMESPACE: "litmus" - INFRA_SCOPE: "namespace" + INFRA_NAME: pod-network-loss-infra + INFRA_NAMESPACE: litmus + INFRA_SCOPE: namespace # Application Info - APP_NS: default - APP_LABEL: run=nginx APP_KIND: deployment # Experiment Configuration @@ -107,6 +116,71 @@ The following environment variables are used to configure the pod-network-loss e
Default Value
APP_NS Provide namespace of application under chaos Optional default
APP_LABEL Provide application label of application under chaos Optional run=nginx
APP_KIND Provide the kind of application Optional
+### Common Environment Variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Variables Description Specify In Chaos Action Default Value
KUBECONFIG Path to kubeconfig file Optional /home/runner/.kube/config
APP_NS Application namespace for chaos testing Optional litmus
ACTIVATE_INFRA Whether to activate infrastructure Optional true
CREATE_ENV Whether to create environment Optional true
ENV_NAME Name of the environment Optional ci-test-env
ENV_TYPE Type of environment Optional NON_PROD
INFRA_ACTIVATION_TIMEOUT Timeout for infrastructure activation Optional 5
LITMUS_USE_EXISTING_PROBE Whether to use existing probe Optional false
APP_LABEL Application label for targeting Optional app=nginx-pod-network-loss
+ ### Infrastructure Setup Variables @@ -235,18 +309,6 @@ The following environment variables are used to configure the pod-network-loss e - - - - - - - - - - - -
Default Value
APP_NS Provide namespace of application under chaos Optional default
APP_LABEL Provide application label of application under chaos Optional run=nginx
APP_KIND Provide the kind of application Optional