From 5456fce924448909ecd2de8f2513d8822dd5d8be Mon Sep 17 00:00:00 2001 From: prubenda Date: Thu, 25 Feb 2021 10:06:10 -0500 Subject: [PATCH] Adding getting started docs --- README.md | 7 +++- docs/contribute.md | 1 + docs/getting_started.md | 81 +++++++++++++++++++++++++++++++++++++++++ docs/pod_scenarios.md | 17 ++++----- run_kraken.py | 7 +--- 5 files changed, 96 insertions(+), 17 deletions(-) create mode 100644 docs/getting_started.md diff --git a/README.md b/README.md index 4c33fa05..c6cabb45 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,17 @@ Kraken injects deliberate failures into Kubernetes/OpenShift clusters to check i ![Kraken workflow](media/kraken-workflow.png) -### Installation and usage +### How to Get Started Instructions on how to setup, configure and run Kraken can be found at [Installation](docs/installation.md). +See the [getting started doc](docs/getting_started.md) on support on how to get started with your own custom scenario or editing current scenarios for your specific usage + +After installation, refer back to the below sections for supported scenarios and how to tweak the kraken config to load them on your cluster + ### Config Instructions on how to setup the config and the options supported can be found at [Config](docs/config.md). - ### Kubernetes/OpenShift chaos scenarios supported Kraken supports pod, node, time/date and [litmus](https://github.com/litmuschaos/litmus) based scenarios. diff --git a/docs/contribute.md b/docs/contribute.md index fcb8f83f..279492e9 100644 --- a/docs/contribute.md +++ b/docs/contribute.md @@ -47,6 +47,7 @@ $ git rebase -i In the interactive rebase screen, set the first commit to `pick` and all others to `squash` (or whatever else you may need to do). + Push your rebased commits (you may need to force), then issue your PR. ``` diff --git a/docs/getting_started.md b/docs/getting_started.md new file mode 100644 index 00000000..c3bfbed5 --- /dev/null +++ b/docs/getting_started.md @@ -0,0 +1,81 @@ +## Getting Started Running Chaos Scenarios + +#### Adding New Scenarios +Adding a new scenario is as simple as adding a new config file under [scenarios directory](https://github.com/cloud-bulldozer/kraken/tree/master/scenarios) and defining it in the main kraken [config](https://github.com/cloud-bulldozer/kraken/blob/master/config/config.yaml#L8). +You can either copy an existing yaml file and make it your own or fill in one of the templates below to suit your needs + +### Templates +#### Pod Scenario Yaml Template +For example, for adding a pod level scenario for a new application, refer to the sample scenario below to know what fields are necessary and what to add in each location: +``` +config: + runStrategy: + runs: + #This will choose a random number to wait between min and max + maxSecondsBetweenRuns: 30 + minSecondsBetweenRuns: 1 +scenarios: + - name: "delete pods example" + steps: + - podAction: + matches: + - labels: + namespace: "" + selector: "" #this can be left blank + filters: + - randomSample: + size: + actions: + - kill: + probability: 1 + force: true + - podAction: + matches: + - labels: + namespace: "" + selector: "" #this can be left blank + retries: + retriesTimeout: + # Amount of time to wait with retrying, before failing if pod count doesn't match expected + timeout: 180 + + actions: + - checkPodCount: + count: + - + node_name: # can be left blank + label_selector: + instance_kill_count: + timeout: + cloud_type: +``` + + +#### Time Chaos Scenario Template +``` +time_scenarios: + - action: 'skew_time' or 'skew_date' + object_type: 'pod' or 'node' + label_selector: