Chapter 5. Writing and Running Your First Automated Chaos Experiment
In Chapter 4 you grabbed the Chaos Toolkit; now it’s time to actually use the toolkit to execute your first automated chaos experiment. In this chapter you’ll set up a simple target system to work your chaos against, then write and run your first automated chaos experiment to surface a weakness in that system. You’ll execute a whole cycle in which your automated chaos experiment is first used to uncover evidence of a weakness, and then used again to validate that the weakness has been overcome—see the diagram in Figure 5-1.
![An image of chaos experiment to surface and validate a weakness.](/api/v2/epubs/9781492050995/files/assets/lece_0501.png)
Figure 5-1. Using a chaos experiment to surface evidence of a weakness, then provide evidence of the weakness being overcome
Setting Up the Sample Target System
You need a system to explore for weaknesses, and everything you need for that is available in the learning-chaos-engineering-book-samples directory in the community-playground
repo under the chaostoolkit-incubator
organization. Grab the code now by cloning the repository with the git
command:
(chaostk) $ git clone https://github.com/chaostoolkit-incubator/community- playground.git
If you’re not comfortable with using git
, you can simply grab the repository’s contents as a zip file.
Getting the Example Code
In actual fact, all the experiments shown in this book are in the chaostoolkit-incubator/community-playground
repo. For more ...
Get Learning Chaos Engineering now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.