Setting up ChaosToolkit Execution Environment
mikotian
Posted on July 11, 2021
Base Setup
Install Python 3.5 on your execution machine.
Windows : Download the latest binary installer from the Python website.
Linux: https://www.python.org/download/other/
Create a virtual environment. Virtual environments help us encapsulate our changes away from the larger system.
python3 -m venv ~/.venvs/resilient
source ~/.venvs/resilient/bin/activate
Install chaostoolkit
pip install chaostoolkit
Verify version
chaos --version
This will install the base version of chaostoolkit with its inbuilt probes, tolerances & actions.
Install AWS Drivers
pip install -U chaostoolkit-aws
Passing Credentials to ChaosToolkit.
For AWS actions/probes to work as expected we need to place a credentials file like below in the following location. ~/.aws
The credentials can be added in the experiment itself, like so
{
"secrets": {
"aws": {
"aws_access_key_id": "your key",
"aws_secret_access_key": "access key",
"aws_session_token": "token"
}
}
}
Thats it, you're all set to run AWS Chaos/resiliency experiments!
Install Toxiproxy Drivers
Install Toxiproxy Server from here: (https://github.com/Shopify/toxiproxy/releases)
Install the toxiproxy CLI (https://github.com/Shopify/toxiproxy/releases)
These are required in order to make the network changes work.
Install the chaos toolkit drivers:
pip install -U chaostoolkit-toxiproxy
Add the following configuration to your experiment.
"configuration": {
"toxiproxy_host" : "10.124.23.183",
"some_environment_variable": {
"type": "environment",
"key": "ENVIRONMENT_VARIABLE"
}
}
Start the toxiproxy server.
Now you are ready to run the experiment.
Posted on July 11, 2021
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.