Google Cloud Platform extension for the Chaos Toolkit
Project description
Google Cloud Platform Extension for the Chaos Toolkit
Welcome to the Google Cloud Platform (GCP) extension for Chaos Toolkit. The package aggregates activities to target your GCP projects and explore your resilience via Chaos Engineering experiments.
Install
This package requires Python 3.8+
To be used from your experiment, this package must be installed in the Python environment where Chaos Toolkit already lives.
$ pip install -U chaostoolkit-google-cloud-platform
Usage
To use the probes and actions from this package, add the following to your experiment file:
{
"version": "1.0.0",
"title": "Our users should not be impacted by increased latency from our services",
"description": "Use traffic shaping from the load Balancer to explore the impact of latency on our users",
"method": [
{
"name": "add-delay-to-traffic",
"type": "action",
"provider": {
"type": "python",
"module": "chaosgcp.lb.actions",
"func": "inject_traffic_delay",
"arguments": {
"url_map": "my-service",
"target_name": "all-paths",
"target_path": "/*",
"delay_in_seconds": 1,
"impacted_percentage": 80
}
},
"pauses": {
"after": 180
}
}
],
"rollbacks": [
{
"name": "remove-traffic-delay",
"type": "action",
"provider": {
"type": "python",
"module": "chaosgcp.lb.actions",
"func": "remove_fault_injection_traffic_policy",
"arguments": {
"url_map": "my-service",
"target_name": "all-paths",
"target_path": "/*"
}
}
}
]
}
That's it! You can now run it as chaos run experiment.json
Please explore the code to see existing probes and actions.
The extension picks up the credentials found on the machine running the experiment as describe in the official Python GCP client.
Contribute
If you wish to contribute more functions to this package, you are more than welcome to do so. Please, fork this project, make your changes following the usual PEP 8 code style, sprinkling with tests and submit a PR for review.
The Chaos Toolkit projects require all contributors must sign a Developer Certificate of Origin on each commit they would like to merge into the master branch of the repository. Please, make sure you can abide by the rules of the DCO before submitting a PR.
Develop
If you wish to develop on this project, make sure to install the development dependencies. You will need to install PDM.
$ pdm install --dev
Whenever you need to make contribution, ensure to run the linter as follows:
$ pdm run format
$ pdm run lint
Now, you can edit the files and they will be automatically be seen by your
environment, even when running from the chaos
command locally.
Test
To run the tests for the project execute the following:
$ pdm run test
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 chaostoolkit_google_cloud_platform-0.19.0.tar.gz
.
File metadata
- Download URL: chaostoolkit_google_cloud_platform-0.19.0.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 397e8b87968b60774455273ba35d0d5ae31dfd8beacf68d142f33f95f976fe17 |
|
MD5 | 195513f8d7c90e42355183354eb492a8 |
|
BLAKE2b-256 | 6f3e51eba270e1f1e82877b465a552337ac6326c6c176dc6d29fc0700b19b1fe |
File details
Details for the file chaostoolkit_google_cloud_platform-0.19.0-py3-none-any.whl
.
File metadata
- Download URL: chaostoolkit_google_cloud_platform-0.19.0-py3-none-any.whl
- Upload date:
- Size: 33.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | df0ab4046964dd628a87ede40412013d491d336f14fe70a956752e1dfa0e050e |
|
MD5 | 41a4ebad93e1747bc0f7468818d9eb9f |
|
BLAKE2b-256 | 117effc3e7abd83773389b64f518e800b8b9d87d25c9f1ee34d876ce9498dbfa |