Let's start with Podtato-head
In this tutorial, you will inject a pod-delete fault into a sample microservices application called 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
Install ChaosCenter​
Follow the Getting-started to install ChaosCenter
Access to 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 shows
CONNECTED
.
Set up Resilience Probe​
Select HTTP Probe as the probe type
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
Run Chaos Experiment with Podtato-head​
- For Kubernetes v1.24 or later, bind a ClusterRole to the
argo-chaos
service account
kubectl create rolebinding argo-chaos-binding --clusterrole=admin --serviceaccount=litmus:argo-chaos -n litmus
- Configure a new chaos experiment
- Name:
podtato-head
- Chaos Infrastructure:
local
- Select Podtato-head Chaos template
- Add the new probe to
pod-delete
fault
- Probe Name:
check-podtato-main-access-probe
- Mode:
Continuous
- Remove the old probe section below from
podtato-head.yml
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
- 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! 🚀