> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/chaos-engineering/troubleshooting-and-resources/training-and-certification/sandbox.md).

# Chaos Sandbox

Get trained in running Harness Chaos Experiments using the sandbox

This tutorial guides you through an interactive session where you'll use the sample application **Podtato head** to execute a chaos experiment and enhance the application's resilience.

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

Before you start the tutorial, ensure you have a Harness account. Follow [these](#create-a-harness-account) steps to create one. Review the [onboarding flow diagram](/resilience-testing/chaos-engineering/troubleshooting-and-resources/training-and-certification/certification.md) to understand the process for obtaining the Harness Developer Certification.

#### Create a Harness account <a href="#create-a-harness-account" id="create-a-harness-account"></a>

1. Navigate to [app.harness.io](https://app.harness.io/auth/#/signin) and click **Sign up**.

   ![navigate](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-9635dc8bf23125eb1a531ccfc29bea5b99cc6662%2Fsign-up.png?alt=media)
2. Select **Sign up with Email** and enter your work email and password.

   ![enter details](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-604a709b2adba96fb04cbac4a5d1f1a3e14353de%2Fcreate-account.png?alt=media)
3. You will receive a verification email. Follow the link to access the page with various modules.

   ![verify](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-b8912363e434e45d7ced6562e06ce12f01cd3204%2Fverify-email.png?alt=media)

### High-level flow of control in a sandbox <a href="#high-level-flow-of-control-in-a-sandbox" id="high-level-flow-of-control-in-a-sandbox"></a>

The diagram below illustrates the high-level flow of control in a sandbox environment:

![control flow](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-0ffe6ba9fd52ad778d4809c0062fd2085b9c415f%2Fsandbox-flow-of-control.png?alt=media)

### Execute pod delete on the Podtato head app <a href="#execute-pod-delete-on-the-podtato-head-app" id="execute-pod-delete-on-the-podtato-head-app"></a>

After creating an account with Harness, select **Get Started** in the **Chaos Engineering** module.

![landing](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-1d7265238e7944aef4d43b2bec2e82d71d387c73%2Flanding-page.png?alt=media)

#### Create a sandbox <a href="#create-a-sandbox" id="create-a-sandbox"></a>

1. On the chaos module landing page, select **Create Sandbox**. Note that this is a **Zero Risk** operation!

   ![select module](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-71ee5d59f529812b42177af668990f910f651113%2Fclick-sandbox.png?alt=media)
2. This action creates a new environment where chaos experiments can be executed.

   ![env](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-7c1ce2cbc36978bc03ba9c27b730b88ab098b8c5%2Fcreate-env.png?alt=media)
3. This takes you to the **Interactive learning** tab, where you click **Start**.

   ![start](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-b536208f64236675a03678de4b527d19232a2343%2Fpod-delete-start.png?alt=media)

{% hint style="info" %}

* Once you create a sandbox, it can't be deleted.
* All users within a sandbox can share the same sandbox.
* The first time you create a sandbox, the session starts automatically. Subsequent sessions must be explicitly started (Click **Start**).
* You are allocated 20 sessions (each 60 minutes) valid for 30 days from sandbox creation date.
* You can **Stop** and **Restart** the session,with unused time being added to your quota.
  {% endhint %}

#### Execute pod delete experiment <a href="#execute-pod-delete-experiment" id="execute-pod-delete-experiment"></a>

1. The experiment execution starts by creating the necessary clusters in the environment (that you created earlier). Once the clusters are ready, the sandbox creates the pod delete experiment. Click Next.

   ![exp created](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-fe75aba708aec97d17cf33c2e8bbe444f9dd3eeb%2Fexp-runs.png?alt=media)
2. Click **Run** to execute the pod delete experiment. The experiment creates resilience probes to check the availability of the Podtato app's left arm, which will be deleted during the experiment.

   ![exp runs](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-51ba8c1c5661385d7d20a1988ec63670b848c5fc%2Fexecute-exp.png?alt=media)
3. The experiment deletes a pod (specifically, the left arm pod) and displays the resilience of the Podtato Head application.

   ![exp runs](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-908cbc3287202cfe7e5aef20913cdfee16c277ee%2Fexp-complete.png?alt=media)

{% hint style="info" %}
The resilience score of 50 indicates that the experiment configured two probes with equal weight. If one probe fails, the score is 50.
{% endhint %}

4. This result shows that the Podtato Head app is not yet resilient. Click **Next** to proceed with configuring the application for improved resilience.

   ![click next](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-222ab127cb184c134960cb29829aed27bd1f1c8a%2Fclick-next.png?alt=media)

{% hint style="info" %}

* You can re-run the experiment.
* You can scale up the Podtato head app only once.
* You can delete the Podtato head left arm only once.
* You can re-run the experiment.
* The pod network loss experiment can only be executed after completing the pod delete experiment.
* Rollbacks to previous steps or experiments are not possible.
  {% endhint %}

#### Re-run to build resilience <a href="#re-run-to-build-resilience" id="re-run-to-build-resilience"></a>

1. You will see two commands on the screen. Click **Run** to execute these commands, which will create two replicas of the pod, enhancing its availability. This way, even if one pod is deleted, the application will continue functioning smoothly.

   ![improve resilience](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-57fbe311412e049d4ffdd1e6b571a0125abfe1ef%2Fimp-resilience.png?alt=media)
2. Click **Next**. Once the application is configured, select **Run** to re-run the experiment.

   ![improve resilience](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-718dd3878a2fdf18d4d3df925b6d052c0b5e8098%2Fre-run-exp.png?alt=media)
3. The pod delete experiment will be executed again. This time, you will see a resilience score of 100 %, indicating that the application remains functional even when a pod is deleted.

   ![improve score](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-f3204bd89c056b0be13e727aa7aaa96d2d8ab8a5%2Fhigh-score.png?alt=media)

{% hint style="info" %}
A resilience score of 100 % means both probes, which were configured with equal weight, passed.

<img src="https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-2f1fcfb173776c0bf63b9a0adb12eccc781cd511%2Fprobe-details.png?alt=media" alt="probe passed" data-size="original">
{% endhint %}

4. Click **Next** to proceed with the next experiment (pod network loss).

   ![execute next](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-38b31c01f1338fba8ade22c5204a623dc251a47c%2Fto-move.png?alt=media)

{% hint style="info" %}
Click **Run** to re-execute the sandbox session if you run out of time.

<img src="https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-f95ea487f6896fe12c375f8181063fe7e93da070%2Fstart-again.png?alt=media" alt="finish" data-size="original">
{% endhint %}

#### Perform the same steps for the next experiment <a href="#perform-the-same-steps-for-the-next-experiment" id="perform-the-same-steps-for-the-next-experiment"></a>

1. After completing the pod delete experiment, you can execute the pod network loss experiment. Follow the same steps as for the pod delete experiment. This experiment configures a probe to check the availability of the Podtato app's left arm, which is targeted.

   ![pod network loss](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-0c567bcc48f58cb177dd279d4b352a4dda378621%2Fpod-nw-loss.png?alt=media)
2. Click **Next** to move to the last step of the hands-on lab.

   ![pod network done](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-abd93b946b2bd81225f48c4f258dcd2cd570b7ed%2Fpod-nw-done.png?alt=media)
3. You have now completed the chaos hands-on lab by executing two experiments and improving the resilience of the Podtato Head application. Click **Go to Harness University** or follow [this](/resilience-testing/chaos-engineering/troubleshooting-and-resources/training-and-certification/certification.md) tutorial to obtain the developer certification.

   ![pod network done](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-401d484545db39470f55757ffb723c6aa0bd71ee%2Fgo-to-cert.png?alt=media)

### Create other experiments in sandbox <a href="#create-other-experiments-in-sandbox" id="create-other-experiments-in-sandbox"></a>

In addition to executing **pod delete** and **pod network loss** experiments, you can create other experiments in the sandbox.

* Navigate to your sandbox and select **Chaos Experiments** to view the experiments you've executed or are currently running.

  ![exp exec](https://2284173296-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FlSkpbpeYJ3rfGUkIrcyQ%2Fuploads%2Fgit-blob-b4d904baaca31f9ca16aaa63bcdfa0a124dba0f4%2Fother-exp.png?alt=media)
* Select **New experiment** and follow the steps to [create an experiment](/resilience-testing/chaos-engineering/use-chaos-engineering/experiments.md).

### Next steps <a href="#next-steps" id="next-steps"></a>

* [Harness Chaos Engineering Developer Certification](/resilience-testing/chaos-engineering/troubleshooting-and-resources/training-and-certification/certification.md)

{% @harness-feedback/feedback %}
