Getting Started with ChaosIQ
This article will guide you through the steps to your first Chaos Engineering Exepriment with ChaosIQ.
To start seeing your chaos engineering experiments in chaosIQ you need to:
Install the Chaos Toolkit CLI
If you’ve already got a working installation of the Chaos Toolkit CLI then you can skip directly to Signin to ChaosIQ with your credentials.
Creating a new Chaos Toolkit CLI installation using pip
The Chaos Toolkit CLI is implemented in Python 3 and so needs a working Python installation at version 3.5+. If when you execute the python3 command on your machine you see something like the following then you are all set:
$ python3 --version Python 3.6.4
If you see a version lower than 3.5 then you’ll first need to install Python.
Install Python 3
Install Python 3 for your system:
$ brew install python3
$ sudo apt-get install python3 python3-venv
$ sudo yum -y install https://centos7.iuscommunity.org/ius-release.rpm $ sudo yum -y install python35u
Notice, on CentOS, the Python 3.5 binary is named
python3.5 rather than
python3 on other systems.
Download the latest binary installer from the Python website.
Create a Python virtual environment
Dependencies can be installed for your Python installation through pip but it’s often a good idea to create a Python virtual environment to contain your Chaos Toolkit CLI installation libraries.
To create a Python virtual environment called chaostk execute the following:
$ python3 -m venv ~/.venvs/chaostk
Now you can activate your virtual environment by executing:
$ source ~/.venvs/chaostk/bin/activate (chaostk) $
Note: The virtualenvwrapper is a great tool that simplifies working with Python virtual environments.
Install the Chaos Toolkit CLI using pip
You install the Chaos Toolkit CLI as the Python chaostoolkit module into your virtual environment by using pip:
(chaostk) $ pip install chaostoolkit
You can verify the the Chaos Toolkit CLI was installed by running:
(chaostk) $ chaos --version chaos, version 1.2.0
That’s it! You’ve got a working installation of the Chaos Toolkit CLI. The next step is to set up your Chaos Toolkit CLI to use your ChaosIQ account and run and publish your first experiment to your ChaosIQ console
Add ChaosIQ to your Chaos Toolkit CLI installationThe ChaosIQ features can be added to your Chaos Toolkit CLI installation by executing:
(chaostk) $ pip install chaosiq-cloud
Signin to ChaosIQ with your credentials
So that your Chaos Toolkit installation can interact with ChaosIQ, you need to set up your credentials using the
When asked for it, generate and copy your token from the Tokens tab in the ChaosIQ Console.
To login using the native
(chaostk) $ chaos signin ChaosIQ Cloud url [https://console.chaosiq.io]: ChaosIQ Cloud token: Experiments and executions will be published to organization 'MyName' ChaosIQ Cloud details saved at ~/.chaostoolkit/settings.yaml
Run and Publish your first experiment to your ChaosIQ console
Now you can execute Chaos Toolkit experiments using the native
chaos command, that will make your experiments and your experiment executions observable, and controllable, in your ChaosIQ console.
(chaostk) export ENDPOINT_URL=https://httpstat.us/200?sleep=2000; \ chaos run https://raw.githubusercontent.com/open-chaos/experiment-catalog/master/local/url-responds/url-responds.json
If you now navigate over to "Executions" in your ChaosIQ Console, you will be able to observe your experiments executing in realtime.