Pumba is a powerful Chaos testing tool for injecting Chaos in Docker. It can kill, pause, stop, and remove Docker containers with highly-configurable selection rules. It can also perform network emulation through delays, packet loss, rate limiting, and more.
Get started by downloading the latest binary release and setting its permissions.
Killing a Random Container
Pumba uses the tc utility for performing network emulation, which is typically installed with the iproute2 tool set. We'll be creating containers using Alpine Linux distributions in these samples, but make sure your own container images contain a copy of the tc utility when performing network emulations.
Injecting Failure Into Docker with Gremlin
Gremlin makes it easy to run Chaos Experiments on Docker containers. You can start running experiments in just a few minutes after installing Docker. Once installed, Gremlin is intelligent enough to recognize each of your unique Docker containers and will accurately apply smart identifier tags, so you can target exactly the right services and systems. Use Gremlin to perform shutdown and CPU experiments against Docker containers.
Check out this tutorial to learn how to install Gremlin on Ubuntu and attack Docker containers. Alternatively, this guide shows how to install Gremlin within a Docker container for use against other containers.
Docker Chaos Monkey
The script kills off the first Docker image with the role=disposable label that also meets the following criteria:
- Must have more than 1 replica.
- Actual and desired replica counts must be equivalent.
Here it is in action.
Docker Simian Army
The Docker Simian Army is a Docker image of the Simian Army Java toolset. It doesn't provide any additional features on its own, but it's a useful alternative to installing the Simian Army locally. You can test it out in dry mode with the following command.
Add the <sup>-d -p 8080:8080</sup> flag to forward port <sup>8080</sup> and connect to the Simian Army REST API.