Chaos for Clouds.
Project description
Chaotic - Chaos for Clouds
Chaotic evaluates a plan, how it will bring chaos in your Cloud environment.
Depending on the Cloud API used, it may kill allocations (Hashicorp Nomad), reboot or stop/start virtual machines in your Cloud environment.
Clouds
Currently implemented Clouds:
- cloudscale.ch
- DigitalOcean
- Hetzner Cloud
- Hashicorp Nomad
- Vultr
- Exoscale
- CloudStack
Install
pip3 install https://github.com/ngine-io/chaotic/archive/master.zip
Configure
Create a file named config.yaml
or use the env var CHAOTIC_CONFIG
to point to a config file:
export CHAOTIC_CONFIG=config_nomad.yaml
Exoscale
Chaotic will stop a server selected by an optional filter tag and stop/start it with a delay of a configurable time (default 60s).
export EXOSCALE_API_KEY="..."
export EXOSCALE_API_SECRET="..."
---
kind: exoscale
dry_run: false
configs:
# Optional, filter tag
tag:
key: chaos
value: enabled
# Optional, 60 seconds is the default
wait_before_restart: 60
CloudStack
Chaotic will stop a server selected by an optional filter tag and stop/start it with a delay of a configurable time (default 60s).
export CLOUDSTACK_API_KEY="..."
export CLOUDSTACK_API_SECRET="..."
export CLOUDSTACK_API_ENDPOINT="..."
---
kind: cloudstack
dry_run: false
configs:
# Optional, filter tag
tag:
key: chaos
value: enabled
# Optional, 60 seconds is the default
wait_before_restart: 60
Vultr
Chaotic will stop a server selected by an optional filter tag and stop/start it with a delay of a configurable time (default 60s).
export VULTR_API_KEY="..."
---
kind: vultr
dry_run: true
configs:
# Optional instance tag filter
tag: "chaos=opt-in"
# Optional, 60 seconds is the default
wait_before_restart: 60
Cloudscale.ch
Chaotic will stop a server selected by an optional filter tag and stop/start it with a delay of a configurable time (default 60s).
Config
export CLOUDSCALE_API_TOKEN="..."
---
kind: cloudscale_ch
dry_run: true
configs:
# Optional server tag filter
filter_tag: "chaos=opt-in"
# Optional, 60 seconds is the default
wait_before_restart: 60
Hetzner Cloud
Chaotic will stop a server selected by an optional filter label and stop/start it with a delay of a configurable time (default 60s).
Config
export HCLOUD_API_TOKEN=...
---
kind: hcloud
dry_run: false
configs:
# Optional server label filter
label: "chaos=enabled"
# Optional, 60 seconds is the default
wait_before_restart: 60
DigitalOcean Cloud
Chaotic will stop a droplet selected by an optional filter tag and stop/start it with a delay of a configurable time (default 60s).
Config
export DIGITALOCEAN_ACCESS_TOKEN=...
---
kind: digitalocean
dry_run: false
configs:
# Optional droplet tag filter
tag: "chaos:enabled"
# Optional, 60 seconds is the default
wait_before_restart: 60
Nomad
Chaotic will send an allocation signal to an allocation in the available namespaces selected by an allow list.
Config
export NOMAD_ADDR=http://nomad.example.com:4646
---
kind: nomad
dry_run: true
configs:
# Signals to choose from
signals:
- SIGKILL
# Optional: namespace allowlist
namespace_allowlist:
- example-prod
- foobar-prod
Run
chaos-ngine
What you should see (cloudscale.ch):
2021-06-09 09:01:25,433 - cloudscale.log:INFO:Started, version: 0.6.2
2021-06-09 09:01:25,433 - cloudscale.log:INFO:Using profile default
2021-06-09 09:01:25,433 - cloudscale.log:INFO:API Token used: xyz...
2021-06-09 09:01:25,433 - chatic:INFO:Querying with filter_tag: None
2021-06-09 09:01:25,433 - cloudscale.log:INFO:HTTP GET to https://api.cloudscale.ch/v1/servers
2021-06-09 09:01:25,651 - cloudscale.log:INFO:HTTP status code 200
2021-06-09 09:01:25,652 - chatic:INFO:Choose server app3
2021-06-09 09:01:25,653 - chatic:INFO:Stopping server app3
2021-06-09 09:01:25,653 - cloudscale.log:INFO:HTTP POST to https://api.cloudscale.ch/v1/servers/d5628484-a6eb-4ea9-b3ef-ba8da2bb9fe0/stop
2021-06-09 09:01:26,336 - cloudscale.log:INFO:HTTP status code 204
2021-06-09 09:01:26,336 - chatic:INFO:Sleeping for server 60
2021-06-09 09:02:26,393 - cloudscale.log:INFO:HTTP POST to https://api.cloudscale.ch/v1/servers/d5628484-a6eb-4ea9-b3ef-ba8da2bb9fe0/start
2021-06-09 09:02:26,955 - cloudscale.log:INFO:HTTP status code 204
2021-06-09 09:02:26,956 - chatic:INFO:done
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chaotic-ngine-0.1.0.tar.gz
.
File metadata
- Download URL: chaotic-ngine-0.1.0.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ae76c1f202b88a2e526ca66bb72f48a223a97357ce1944885c754ee84b00c63 |
|
MD5 | c08a1851591a620a8a4058b4359f5294 |
|
BLAKE2b-256 | 3357e71298e6846bb8d6ce81d489b786b93b55d5b99715855f00c0b5674c9bd1 |
File details
Details for the file chaotic_ngine-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: chaotic_ngine-0.1.0-py3-none-any.whl
- Upload date:
- Size: 10.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25a1dd0554221b27e8bf41a94646eb62c1e1e5320455193b3cd59e692d0841c4 |
|
MD5 | 4f73e81de8a466db3cddfe2411bf80d4 |
|
BLAKE2b-256 | 71f5568f1cd2e6867bde3bd02464fbc7b56cf9b268c3e91bc93a210428ae35af |