Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Tutorials" sidebar and create new podtato-head tutorial #302

Merged
merged 8 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions website/docs/tutorials/podtato-head.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
id: podtato-head
title: Let's start with Podtato-head
sidebar_label: Podtato-head
---

---
suhyenim marked this conversation as resolved.
Show resolved Hide resolved

![podtato-head](../assets/tutorials/podtato-head/podtato-head.png)

In this tutorial, you will inject a pod-delete fault into a sample microservices application called [podtato-head](https://github.com/cncf/podtato-head) and verify if the service continues to be available during the chaos duration.

## Prerequisites

- Kubernetes 1.18 or later (minimum 2 vCPUs, 8GB RAM, 10GB disk space)

- A Persistent volume of 20GB

- [Helm3](https://v3.helm.sh/) or [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)

## Install ChaosCenter

1. Follow the [Getting-started](../getting-started/installation.md) to install ChaosCenter

2. Access to ChaosCenter Dashboard

![chaoscenter-dashboard](../assets/tutorials/podtato-head/chaoscenter-dashboard.png)

## Set up Environment
1. Add a new environment
- Environment Name: `local`
- Environment Type: `Production`

![local-environment](../assets/tutorials/podtato-head/local-environment.png)

## Enable Chaos Infrastructure

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

```bash
kubectl apply -f local-litmus-chaos-enable.yml
```

3. Wait until the status shows `CONNECTED`.

![connected](../assets/tutorials/podtato-head/connected.png)

## Set up Resilience Probe

1. Select HTTP Probe as the probe type

2. Configure properties & probe details
- Name: `check-podtato-main-access-probe`
- Timeout: `10s`
- Interval: `1s`
- Attempt: `1`
- URL: `http://podtato-main.{{workflow.parameters.adminModeNamespace}}.svc.cluster.local:9000`
- Method: `GET`
- Criteria: `==`
- Response Code: `200`

![setup-probe](../assets/tutorials/podtato-head/setup-probe.png)

## Run Chaos Experiment with Podtato-head
1. For Kubernetes v1.24 or later, bind a ClusterRole to the `argo-chaos` service account
suhyenim marked this conversation as resolved.
Show resolved Hide resolved

```bash
kubectl create rolebinding argo-chaos-binding --clusterrole=admin --serviceaccount=litmus:argo-chaos -n litmus
```

2. Configure a new chaos experiment
- Name: `podtato-head`
- Chaos Infrastructure: `local`

3. Select **Podtato-head Chaos** template

![podtato-head-template](../assets/tutorials/podtato-head/podtato-head-template.png)

4. Add the new probe to `pod-delete` fault
- Probe Name: `check-podtato-main-access-probe`
- Mode: `Continuous`

![add-probe](../assets/tutorials/podtato-head/add-probe.png)

5. Remove the old probe section below from `podtato-head.yml`

```yaml
probe:
- name: "check-podtato-main-access-url"
type: "httpProbe"
httpProbe/inputs:
url: "http://podtato-main.{{workflow.parameters.adminModeNamespace}}.svc.cluster.local:9000"
insecureSkipVerify: false
method:
get:
criteria: "=="
responseCode: "200"
mode: "Continuous"
runProperties:
probeTimeout: 1s
interval: 100ms
attempt: 1
```

6. Save and run the chaos experiment

## Check Chaos Experiment Results

- Experiment Status: `COMPLETED`
- Resilience Score: `100%`
- Probe Result: `PASSED`

![experiment-result](../assets/tutorials/podtato-head/experiment-result.png)

---
suhyenim marked this conversation as resolved.
Show resolved Hide resolved

Congratulations! 🎉 You've successfully completed the tutorial.
Continue exploring more tutorials to enjoy your journey with LitmusChaos! 🚀
suhyenim marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 3 additions & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ module.exports = {
{
Integrations: ['integrations/prometheus', 'integrations/grafana', 'integrations/backstage']
},
{
Tutorials: ['tutorials/podtato-head']
},
'troubleshooting',
'best-practices',
'glossary',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
124 changes: 124 additions & 0 deletions website/versioned_docs/version-3.12.0/tutorials/podtato-head.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
---
id: podtato-head
title: Let's start with Podtato-head
sidebar_label: Podtato-head
---

---

![podtato-head](../assets/tutorials/podtato-head/podtato-head.png)

In this tutorial, you will inject a pod-delete fault into a sample microservices application called [podtato-head](https://github.com/cncf/podtato-head) and verify if the service continues to be available during the chaos duration.

## Prerequisites

- Kubernetes 1.18 or later (minimum 2 vCPUs, 8GB RAM, 10GB disk space)

- A Persistent volume of 20GB

- [Helm3](https://v3.helm.sh/) or [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)

## Install ChaosCenter

1. Follow the [Getting-started](../getting-started/installation.md) to install ChaosCenter

2. Access to ChaosCenter Dashboard

![chaoscenter-dashboard](../assets/tutorials/podtato-head/chaoscenter-dashboard.png)

## Set up Environment
1. Add a new environment
- Environment Name: `local`
- Environment Type: `Production`

![local-environment](../assets/tutorials/podtato-head/local-environment.png)

## Enable Chaos Infrastructure

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

```bash
kubectl apply -f local-litmus-chaos-enable.yml
```

3. Wait until the status shows `CONNECTED`.

![connected](../assets/tutorials/podtato-head/connected.png)

## Set up Resilience Probe

1. Select HTTP Probe as the probe type

2. Configure properties & probe details
- Name: `check-podtato-main-access-probe`
- Timeout: `10s`
- Interval: `1s`
- Attempt: `1`
- URL: `http://podtato-main.{{workflow.parameters.adminModeNamespace}}.svc.cluster.local:9000`
- Method: `GET`
- Criteria: `==`
- Response Code: `200`

![setup-probe](../assets/tutorials/podtato-head/setup-probe.png)

## Run Chaos Experiment with Podtato-head
1. For Kubernetes v1.24 or later, bind a ClusterRole to the `argo-chaos` service account

```bash
kubectl create rolebinding argo-chaos-binding --clusterrole=admin --serviceaccount=litmus:argo-chaos -n litmus
```

2. Configure a new chaos experiment
- Name: `podtato-head`
- Chaos Infrastructure: `local`

3. Select **Podtato-head Chaos** template

![podtato-head-template](../assets/tutorials/podtato-head/podtato-head-template.png)

4. Add the new probe to `pod-delete` fault
- Probe Name: `check-podtato-main-access-probe`
- Mode: `Continuous`

![add-probe](../assets/tutorials/podtato-head/add-probe.png)

5. Remove the old probe section below from `podtato-head.yml`

```yaml
probe:
- name: "check-podtato-main-access-url"
type: "httpProbe"
httpProbe/inputs:
url: "http://podtato-main.{{workflow.parameters.adminModeNamespace}}.svc.cluster.local:9000"
insecureSkipVerify: false
method:
get:
criteria: "=="
responseCode: "200"
mode: "Continuous"
runProperties:
probeTimeout: 1s
interval: 100ms
attempt: 1
```

6. Save and run the chaos experiment

## Check Chaos Experiment Results

- Experiment Status: `COMPLETED`
- Resilience Score: `100%`
- Probe Result: `PASSED`

![experiment-result](../assets/tutorials/podtato-head/experiment-result.png)

---

Congratulations! 🎉 You've successfully completed the tutorial.
Continue exploring more tutorials to enjoy your journey with LitmusChaos! 🚀
5 changes: 5 additions & 0 deletions website/versioned_sidebars/version-3.12.0-sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,11 @@
"integrations/backstage"
]
},
{
"Tutorials": [
"tutorials/podtato-head"
]
},
"troubleshooting",
"best-practices",
"glossary",
Expand Down
Loading