Let's start with Podtato-head
In this tutorial, you will inject a pod-delete fault into the podtato-head-hat
pod of the sample microservices application, podtato-head, and check if the pod remains available during the chaos.
What is Podtato-head?​
Podtato-head is a sample application provided by the CNCF designed for practicing Kubernetes and cloud-native environments. This application is composed of several microservices, including frontend, hat, left/right-arm, and left/right-leg. It serves as an environment for experimenting with fault recovery capabilities and testing the system resilience.
Prerequisites​
- Kubernetes 1.18 or later (minimum 2 vCPUs, 8GB RAM, 10GB disk space)
- A Persistent volume of 20GB
- Kubectl
Install Podtato-head​
- Install
podtato-head
in thepodtato-kubectl
namespace using the manifest file, which also creates the namespace
kubectl apply -f https://github.com/podtato-head/podtato-head-app/releases/download/v0.3.3/manifest.yaml
- Add a label to the
podtato-head-hat
deployment
kubectl label deployment podtato-head-hat app=podtato-head-hat -n podtato-kubectl
Install ChaosCenter​
Follow the Getting-started guide to install ChaosCenter
Access the ChaosCenter Dashboard
Set up Environment​
- Add a new environment
- Environment Name:
local
- Environment Type:
Production
Enable Chaos Infrastructure​
- Configure a new chaos infrastructure
- Name:
local
- Chaos Components Installation:
Cluster-wide access
- Installation Location (Namespace):
litmus
- Service Account Name:
litmus
- Deploy the new chaos infrastructure
kubectl apply -f local-litmus-chaos-enable.yml
- Wait until the status changes to
CONNECTED
.
Set up Resilience Probe​
Select CMD Probe as the probe type
Configure the probe properties and details
- Name:
check-podtato-head-hat-pod
- Timeout:
10s
- Interval:
1s
- Attempt:
1
- Command:
kubectl get pods -n podtato-kubectl | grep podtato-head-hat | grep Running | wc -l
- Type:
Int
- Comparison Criteria:
>
- Value:
0
Run Chaos Experiment​
- Start a new chaos experiment
- Name:
podtato-head
- Chaos Infrastructure:
local
- Builder Type:
Blank Canvas
- Add the
pod-delete
chaos fault
- Select the target application for the
pod-delete
chaos fault
- App Kind:
deployment
- App Namespace:
podtato-kubectl
- App Label:
app=podtato-head-hat
- Add the probe to the
pod-delete
chaos fault
- Probe Name:
check-podtato-head-hat-pod
- Mode:
EOT
- Save and run the chaos experiment
Check Chaos Experiment Results​
- Experiment Status:
COMPLETED
- Resilience Score:
100%
- Probe Result:
PASSED
Congratulations! 🎉 You've successfully completed the tutorial.
Continue exploring more tutorials to enjoy your journey with LitmusChaos! 🚀