Skip to content

Instantly share code, notes, and snippets.

@adhorn
Created April 22, 2020 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save adhorn/c315cb13331528b09f39a592344ec7cb to your computer and use it in GitHub Desktop.
Save adhorn/c315cb13331528b09f39a592344ec7cb to your computer and use it in GitHub Desktop.
Chaos Toolkit experiment to stop docker locally
{
"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