https://github.com/techprimers/defensive-demo
Defensive Demo to test Chaos Engineering using Chaos Toolkit and Chaos Monkey for Spring Boot
https://github.com/techprimers/defensive-demo
chaos-engineering chaos-monkey chaos-monkey-spring-boot chaos-toolkit defensive-demo spring-boot
Last synced: 9 months ago
JSON representation
Defensive Demo to test Chaos Engineering using Chaos Toolkit and Chaos Monkey for Spring Boot
- Host: GitHub
- URL: https://github.com/techprimers/defensive-demo
- Owner: TechPrimers
- Created: 2020-05-15T17:19:59.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-17T08:51:24.000Z (about 6 years ago)
- Last Synced: 2025-03-28T22:51:13.807Z (over 1 year ago)
- Topics: chaos-engineering, chaos-monkey, chaos-monkey-spring-boot, chaos-toolkit, defensive-demo, spring-boot
- Language: Java
- Homepage:
- Size: 57.6 KB
- Stars: 4
- Watchers: 0
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Defensive Demo
This DEMO project is used for running Chaos Experiment
## REST endpoints
- `/actuator/chaosmonkey` - Chaos Monkey for Spring Boot
- `/employee/all` - Return employees from DB (H2)
## Chaos Experiments
Set virtual environment in python and install `chaostoolkit-spring`
```
python3 -m venv ~/.venvs/chaostk
source ~/.venvs/chaostk/bin/activate
pip install chaostoolkit-spring
```
Run the experiment:
`chaos run experiments.json`
Output:
```
(chaostk) chaostk > chaos run experiments.json
[2020-05-17 12:24:50 INFO] Validating the experiment's syntax
[2020-05-17 12:24:50 INFO] Experiment looks valid
[2020-05-17 12:24:50 INFO] Running experiment: Employee when database is down
[2020-05-17 12:24:50 INFO] Steady state hypothesis: Employee data is available
[2020-05-17 12:24:50 INFO] Probe: we-can-retrieve-employee-data
[2020-05-17 12:24:50 INFO] Steady state hypothesis is met!
[2020-05-17 12:24:50 INFO] Action: enable_chaosmonkey
[2020-05-17 12:24:50 INFO] Action: configure_assaults
[2020-05-17 12:24:50 INFO] Action: configure_repository_watcher
[2020-05-17 12:24:50 INFO] Steady state hypothesis: Employee data is available
[2020-05-17 12:24:50 INFO] Probe: we-can-retrieve-employee-data
[2020-05-17 12:24:50 INFO] Steady state hypothesis is met!
[2020-05-17 12:24:50 INFO] Let's rollback...
[2020-05-17 12:24:50 INFO] Rollback: disable_chaosmonkey
[2020-05-17 12:24:50 INFO] Action: disable_chaosmonkey
[2020-05-17 12:24:50 INFO] Experiment ended with status: completed
```