This experiment executes SIGKILL on container of random replicas of an application deployment. It tests the deployment sanity (replica availability & uninterrupted service) and recovery workflows of an application. Check container kill docs for more info. To know more and get started with chaos-actions visit github-chaos-actions.
A Sample workflow to run the container-kill experiment:
.github/workflows/main.yml
name: CI
on:
push:
branches: [master]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Running container kill 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: container-kill
##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: 20
CHAOS_INTERVAL: 10
CONTAINER_RUNTIME: docker
##Select true if you want to uninstall litmus after chaos
LITMUS_CLEANUP: true
The application pod for container-kill will be identified with the app info variables.
Supported Chaos Action Tunables
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 nginx |
CHAOS_INTERVAL | Time interval b/w two successive container kill (in seconds) | Optional | Default value is 10s |
TOTAL_CHAOS_DURATION | The time duration for chaos injection (seconds) | Optional | Default value is 20s |
APP_NS | Provide namespace of application under chaos | Optional | Default value is default |
APP_LABEL | Provide application label of application under chaos. | Optional | Default value is run=nginx |
APP_KIND | Provide the kind of application | Optional | Default value is deployment |
INSTALL_LITMUS | Keep it true to install litmus if litmus is not already installed. | Optional | Default value is not set to true |
LITMUS_CLEANUP | Keep it true to uninstall litmus after chaos | Optional | Default value is not set to true |
CONTAINER_RUNTIME | Give the target container runtime | Optional | Default value is 'docker' |
EXPERIMENT_IMAGE | We can provide custom image for running chaos experiment | Optional | Default value is 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 |
IMAGE_PULL_POLICY | We can set the image pull policy while using custom image for running chaos experiment | Optional | Default value is Always |