Signed-off-by: Rahul M Chheda <rahul.chheda@mayadata.io> |
||
|---|---|---|
| .. | ||
| README.md | ||
| chaos_executor_job.yml | ||
| engine_env_getter.yml | ||
| executor.yml | ||
| experiment_configmap.yml | ||
| experiment_env_getter.yml | ||
| experiment_env_patcher.yml | ||
| test.yml | ||
README.md
Litmus Chaos Executor
- The executor runs the litmus jobs & monitors them. Typically invoked by the litmuschaos operator to run experiments listed in the chaosengine
- To learn more about the chaosengine & chaosexperiment resources, see chaos operator
How to Override ChaosExperiment defaults
-
To override the ENV variables in the chaos experiment CRs, perform one of the below steps before applying the manifest:
- Make changes in the ChaosExperiment CR manifest,
apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: kubernetes-state-pod-delete-v0.1.0 version: 0.1.0 spec: definition: args: - -c - ansible-playbook ./experiments/chaos/kubernetes/pod_delete/test.yml -i /etc/ansible/hosts -vv; exit 0 command: - /bin/bash env: - name: ANSIBLE_STDOUT_CALLBACK value: default - name: TOTAL_CHAOS_DURATION value: 15 <---- EDIT HERE - name: CHAOS_INTERVAL value: 5 - name: LIB value: "" image: "" labels: name: pod-delete litmusbook: /experiments/chaos/kubernetes/pod_delete/run_litmus_test.yml -
Add those variables in the component spec of the respective experiments in the chaosEngine CR manifest
apiVersion: litmuschaos.io/v1alpha1 kind: ChaosEngine metadata: name: engine-nginx namespace: default spec: monitorenable: true appinfo: appkind: deployment applabel: app=nginx appns: default chaosServiceAccount: nginx experiments: - name: container-kill spec: components: - name: TARGET_CONTAINER <------ ADD HERE value: jackma
How to Delete stale / completed jobs after chaosExperiment Execution
-
To ensure the completed experiment jobs are removed, set
spec.jobCleanupPolicytodeleteapiVersion: litmuschaos.io/v1alpha1 kind: ChaosEngine metadata: name: engine-nginx namespace: litmus spec: jobCleanUpPolicy: "" <-------------- ADD HERE appinfo: appns: litmus # FYI, To see app label, apply kubectl get pods --show-labels applabel: "app=hello-deployment" chaosServiceAccount: litmus experiments: - name: pod-delete spec: components: - name: FORCE value: "true"
Limitations
-
Executor is currently unable to parse more than one configmap.
-
The name of file which contains data for configmap in experimentCR should be parameters.yml
-
The configmap is mounted in this default directory: /mnt/