Building Artillery.io • Interested in OSS, SRE, product design, SaaS • always up for coffee ☕ • h@veldstra.org • @hveldstra
I’m excited to release v1 of Chaos Llama, my latest open-source project under the banner of Shoreditch Ops.
V /'>>> /*/ _____ _____ _____ _____ _____ / / | | | | _ | | __| /*/ | --| | | | |__ | / / |_____|__|__|__|__|_____|_____| -------/*/ __ __ _____ _____ _____ --/ * * */ | | | | | _ | | _ | /* * * */ | |__| |__| | | | | | - --- -/ |_____|_____|__|__|_|_|_|__|__| H H H H -- --
Chaos Llama is a small utility for testing the relisience of AWS architectures to random failures.
Once deployed, Chaos Llama will pick and terminate instances at random at some configurable interval. The idea is to constantly test your system’s ability to keep running despite partial failure of some components making the system more resilient to outages overall.
If this sounds familiar, that’s because Chaos Llama is inspired by Netflix’s notorious Chaos Monkey. The main difference between Chaos Monkey and Chaos Llama is simplicity. Whereas Chaos Monkey requires an EC2 instance to be created, configured and maintained to run, Chaos Llama takes advantage of AWS Lambda and can be installed and deployed in a matter of minutes. The flipside of that is that Chaos Llama has a smaller feature set and only runs on AWS.
There are two parts to Chaos Llama: the CLI that lets you deploy and configure Llama, and the AWS Lambda function which picks and terminates an instance when it’s run.
Install the CLI with:
npm install -g llama-cli
(If you don’t have Node.js/npm installed, grab an installer for your platform from nodejs.org.)
To deploy Llama, you’ll need an IAM User (for the CLI to run as) and an IAM Role (for the lambda).
Sset up an IAM user (if you don’t have one already):
chaos_llama
~/.aws/credentials
: [llama]
aws_access_key_id=YOUR_KEY_ID_HERE
aws_secret_access_key=YOUR_ACCESS_KEY_HERE
llama_cli
and go to the Permissions tab and attach these policies:
AmazonLambdaFullAccess
These will allow the Llama CLI to create the lambda.
Then, create a Role for Llama’s lambda function:
chaos_llama
AmazonEC2FullAccess
in the list of policiesOnce the IAM User is set up and your have the role ARN, run:
AWS_PROFILE=llama llama deploy -r $LAMBDA_ROLE_ARN
This will deploy Chaos Llama to your AWS environment, but it won’t actually do anything by default.
To configure termination rules, run deploy
with a Llamafile:
AWS_PROFILE=llama llama deploy -c Llamafile.json
A Llamafile is a JSON file that configures your Chaos Llama:
{
"interval": "60",
"enableForASGs": [
],
"disableForASGs": [
]
}
The options are:
interval
(in minutes) - how frequently Chaos Llama should run. The minimum
value is 5
, and the default value is 60
.enableForASGs
- opt-in the ASGs that instances may be selected from for termination. An empty list ([]
) would effectively disable the llama.disableForASGs
- opt-out ASGs from being selected; instances in any
other ASG are eligible for termination.If both enableForASGs
and disableForASGs
are specified, then only
enableForASGs
rules are applied.
Would you like to contribute? The Issues is a good place to start for some ideas. Feel free to email me on h@veldstra.org if you have any questions.
Nobody whips this llama’s ass.