An open API service indexing awesome lists of open source software.

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

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

```