Forked from adhorn/gist:c315cb13331528b09f39a592344ec7cb
Created
December 6, 2020 12:13
-
-
Save rsrini7/b5efc340024f1128e52a641959439852 to your computer and use it in GitHub Desktop.
Chaos Toolkit experiment to stop docker locally
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "1.0.0", | |
"title": "What is the impact of an terminating the database master", | |
"description": "terminating the master database should not prevent the application from running", | |
"tags": ["db"], | |
"configuration": { | |
"endpoint_url": { | |
"type": "env", | |
"key": "ELEANOR_URL" | |
} | |
}, | |
"contributions": { | |
"reliability": "high", | |
"security": "none", | |
"scalability": "medium" | |
}, | |
"steady-state-hypothesis": { | |
"title": "Application responds", | |
"probes": [ | |
{ | |
"type": "probe", | |
"name": "we-can-request-health", | |
"tolerance": 200, | |
"provider": { | |
"type": "http", | |
"timeout": 15, | |
"verify_tls": false, | |
"url": "${endpoint_url}" | |
} | |
} | |
] | |
}, | |
"method": [ | |
{ | |
"type": "action", | |
"name": "get-pid-master-db", | |
"provider": { | |
"type": "process", | |
"path": "docker", | |
"arguments": "ps -qf 'name=master' > pid.info" | |
} | |
}, { | |
"type": "action", | |
"name": "stop-master-db", | |
"provider": { | |
"type": "process", | |
"path": "docker", | |
"arguments": "stop $(cat pid.info)" | |
}, | |
"pauses": { | |
"after": 10 | |
} | |
}, | |
{ | |
"type": "probe", | |
"name": "read-echo", | |
"provider": { | |
"type": "http", | |
"timeout": 2, | |
"verify_tls": false, | |
"url": "${endpoint_url}" | |
} | |
} | |
], | |
"rollbacks": [ | |
{ | |
"type": "action", | |
"name": "restart-master-db", | |
"provider": { | |
"type": "process", | |
"path": "docker", | |
"arguments": "start $(cat pid.info)" | |
}, | |
"pauses": { | |
"after": 10 | |
} | |
}, | |
{ | |
"type": "probe", | |
"name": "read-echo", | |
"provider": { | |
"type": "http", | |
"timeout": 2, | |
"verify_tls": false, | |
"url": "${endpoint_url}" | |
} | |
} | |
] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment