Difficulty: beginner
Estimated Time: 7 minutes

In this scenario you will learn how to write a simple Chaos Toolkit experiment and then use the chaos run command to execute your experiment.

Great work again! You have now seen how to create, execute and learn from a simple Chaos Experiment that can be executed using the Chaos Toolkit.

You've also seen the output from running your experiment and learnt how to understand what it is trying to tell you in terms of potential weaknesses in your system.

It's now time to do some chaos exploration for real against a Kubernetes environment... fast forward to the next Tutorial to see how to run a full chaos experiment against microservices running in Kubernetes and learn how a chaos experiment can be used to discover and then overcome a system weakness that crucially affects your system's availability...

Don’t stop now! The next scenario will only take about 10 minutes to complete.

Running your first Chaos Experiment

Step 1 of 7

Introducing the 'chaos run' command

The Chaos Toolkit CLI, called chaos, comes with the run command that can be used to execute a chaos experiment that has been defined in JSON using the Chaos Toolkit's open format.

To use the chaos command you need to turn on the Python virtual environment that the command is installed into:

source ~/.venvs/chaostk/bin/activate

With the chaostk virtual environment activated, you should now be able to execute the chaos run command:

chaos run

Running chaos run without any further information will result in you being prompted to specify a path. This should be a path to a valid Chaos Toolkit chaos experiment specification, and you don't have one yet...

In the next step of this scenario you'll write your first, very simple chaos engineering experiment...