diff --git a/website/docs/assets/tutorials/podtato-head/litmus-chaos-create-new-environment-page.png b/website/docs/assets/tutorials/podtato-head/litmus-chaos-create-new-environment-page.png new file mode 100644 index 00000000..01218e79 Binary files /dev/null and b/website/docs/assets/tutorials/podtato-head/litmus-chaos-create-new-environment-page.png differ diff --git a/website/docs/tutorials/overview.md b/website/docs/tutorials/overview.md index f27399b7..93543f3f 100644 --- a/website/docs/tutorials/overview.md +++ b/website/docs/tutorials/overview.md @@ -6,8 +6,8 @@ sidebar_label: Overview --- -The Tutorials section offers hands-on guides for Litmus users to experiment with various tools and environments. This section does not cover the detailed installation steps, which can be found in the [Getting-started](../getting-started/installation.md) section. +This section offers hands-on guides for Litmus users to experiment with various tools and environments. It does not cover any detailed installation guides, however, you can find them in the [Getting Started](../getting-started/installation.md) section. ### [Let's Start with Podtato-head](podtato-head.md) -This tutorial guides users on how to inject a pod-delete fault into one of the pods in the [podtato-head](https://github.com/cncf/podtato-head) microservice and verify its availability during the chaos. +A guide on injecting a pod-delete fault into a pod in the [podtato-head](https://github.com/cncf/podtato-head) microservice and test its availability during the chaos. diff --git a/website/docs/tutorials/podtato-head.md b/website/docs/tutorials/podtato-head.md index 699e1228..6e2df601 100644 --- a/website/docs/tutorials/podtato-head.md +++ b/website/docs/tutorials/podtato-head.md @@ -1,14 +1,12 @@ --- id: podtato-head -title: Let's Start with Podtato-head -sidebar_label: Let's Start with Podtato-head ---- - +title: Injecting a pod-delete fault into a Pod +sidebar_label: Injecting a pod-delete fault into a Pod --- ![podtato-head](../assets/tutorials/podtato-head/podtato-head.png) -In this tutorial, you will inject a pod-delete fault into the `podtato-head-hat` pod of the sample microservices application, [podtato-head](https://github.com/cncf/podtato-head), and check if the pod remains available during the chaos. +A pod-delete fault is a fault injection experiment that intentionally deletes Kubernetes pods to test the resilience and self-healing capabilities of the system. In this tutorial, you will inject a pod-delete fault into the `podtato-head-hat` pod of the sample microservices application, [podtato-head](https://github.com/cncf/podtato-head), and check if the pod remains available during the chaos. ## What is Podtato-head? @@ -18,61 +16,61 @@ In this tutorial, you will inject a pod-delete fault into the `podtato-head-hat` - Kubernetes 1.18 or later (minimum 2 vCPUs, 8GB RAM, 10GB disk space) - A Persistent volume of 20GB -- [Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) +- [Kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl) installed on your system +- ChaosCenter installed on your system. You can follow the [Getting Started](../getting-started/installation.md) guide to install it. -## Install Podtato-head +## Step 1: Install Podtato-head -1. Install `podtato-head` in the `podtato-kubectl` namespace using the manifest file, which also creates the namespace +1. Run the command below to create a `podtato-kubectl` namespace and install `podtato-head` in it using the manifest file: ```bash -kubectl apply -f https://github.com/podtato-head/podtato-head-app/releases/download/v0.3.3/manifest.yaml +kubectl apply -f https://github.com/podtato-head/podtato-head-app/releases/download/v0.3.3/manifest.yaml ``` -2. Add a label to the `podtato-head-hat` deployment +2. Run the command below to label the `podtato-head-hat` deployment in the `podtato-kubectl` namespace: ```bash kubectl label deployment podtato-head-hat app=podtato-head-hat -n podtato-kubectl ``` -## Install ChaosCenter - -1. Follow the [Getting-started](../getting-started/installation.md) guide to install ChaosCenter +Adding a label allows you to specifically target the pod during a Chaos experiment. -2. Access the ChaosCenter Dashboard +## Step 2: Set up Environment -![chaoscenter-dashboard](../assets/tutorials/podtato-head/chaoscenter-dashboard.png) +1. On your ChaosCenter dashboard, navigate to "**Environments**" and create a new environment with the following details: -## Set up Environment - -1. Add a new environment - Environment Name: `local` - Environment Type: `Production` -![local-environment](../assets/tutorials/podtato-head/local-environment.png) +![chaos center create new environment page](../assets/tutorials/podtato-head/litmus-chaos-create-new-environment-page.png) + +## Step 3: Enable Chaos Infrastructure in your Environment -## Enable Chaos Infrastructure +1. Configure a new chaos infrastructure with the following details: -1. Configure a new chaos infrastructure - Name: `local` - Chaos Components Installation: `Cluster-wide access` - Installation Location (Namespace): `litmus` - Service Account Name: `litmus` -2. Deploy the new chaos infrastructure +2. Deploy the new chaos infrastructure by running: ```bash kubectl apply -f local-litmus-chaos-enable.yml ``` -3. Wait until the status changes to `CONNECTED`. +3. Wait until the status changes to `CONNECTED` -![connected](../assets/tutorials/podtato-head/connected.png) +![local environment showing connected status](../assets/tutorials/podtato-head/connected.png) -## Set up Resilience Probe +## Step 4: Set up Resilience Probe + +You need to set up a resilience probe to automatically verify whether the pod remains operational after a fault is injected. For this tutorial, you will use a command-based probe because it allows you to run a specific shell command that checks the status of the target resource (in this case, ensuring the podtato-head-hat pod is running). 1. Select **CMD Probe** as the probe type -2. Configure the probe properties and details +2. Configure the probe properties and details with the following: + - Name: `check-podtato-head-hat-pod` - Timeout: `10s` - Interval: `1s` @@ -84,9 +82,10 @@ kubectl apply -f local-litmus-chaos-enable.yml ![setup-probe](../assets/tutorials/podtato-head/setup-probe.png) -## Run Chaos Experiment +## Step 5: Run Chaos Experiment 1. Start a new chaos experiment + - Name: `podtato-head` - Chaos Infrastructure: `local` - Builder Type: `Blank Canvas` @@ -98,6 +97,7 @@ kubectl apply -f local-litmus-chaos-enable.yml ![add-pod-delete](../assets/tutorials/podtato-head/add-pod-delete.png) 3. Select the target application for the `pod-delete` chaos fault + - App Kind: `deployment` - App Namespace: `podtato-kubectl` - App Label: `app=podtato-head-hat` @@ -105,6 +105,7 @@ kubectl apply -f local-litmus-chaos-enable.yml ![select-target-application](../assets/tutorials/podtato-head/select-target-application.png) 4. Add the probe to the `pod-delete` chaos fault + - Probe Name: `check-podtato-head-hat-pod` - Mode: `EOT` @@ -123,4 +124,4 @@ kubectl apply -f local-litmus-chaos-enable.yml --- Congratulations! 🎉 You've successfully completed the tutorial. -Continue exploring more tutorials to enjoy your journey with LitmusChaos! 🚀 +Continue exploring more tutorials to enjoy your journey with LitmusChaos! 🚀