Chaos engine
Bind an instance of a given app with one or more chaos experiments, define run characteristics, override chaos defaults, define steady-state hypothesis, reconciled by Litmus Chaos Operator.
This section describes the fields in the Chaos engine spec and the possible values that can be set against the same.
State Specifications
It is a user-defined flag to trigger chaos. Setting it to active ensures the successful execution of chaos. Patching it with stop aborts ongoing experiments. It has a corresponding flag in the chaos engine status field, called engineStatus which is updated by the controller based on the actual state of the chaos engine. You can tune it using the engineState field. It supports active and stop values.
Field | .spec.engineState |
---|---|
Description | Flag to control the state of the chaos engine |
Type | Mandatory |
Range | active , stop |
Default | active |
Notes | The engineState in the spec is a user defined flag to trigger chaos. Setting it to active ensures successful execution of chaos. Patching it with stop aborts ongoing experiments. It has a corresponding flag in the chaos engine status field, called engineStatus which is updated by the controller based on actual state of the chaos engine. |
Use the following example to tune this:
# contains the chaosengine state
# supports: active and stop states
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
# contains the state of engine
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
Application Specifications
It contains AUT (application under test) details provided at spec.appinfo
inside chaosengine.
Field | .spec.appinfo.appns |
---|---|
Description | Flag to specify namespace of application under test |
Type | Optional |
Range | user-defined (type: string) |
Default | n/a |
Notes | The appns in the spec specifies the namespace of the AUT. Usually provided as a quoted string. It is optional for the infra chaos. |
Field | .spec.appinfo.applabel |
---|---|
Description | Flag to specify unique label of application under test |
Type | Optional |
Range | user-defined (type: string)(pattern: "label_key=label_value") |
Default | n/a |
Notes | The applabel in the spec specifies a unique label of the AUT. Usually provided as a quoted string of pattern key=value. Note that if multiple applications share the same label within a given namespace, the AUT is filtered based on the presence of the chaos annotation litmuschaos.io/chaos: "true" . If, however, the annotationCheck is disabled, then a random application (pod) sharing the specified label is selected for chaos. It is optional for the infra chaos. |
Field | .spec.appinfo.appkind |
---|---|
Description | Flag to specify resource kind of application under test |
Type | Optional |
Range | deployment , statefulset , daemonset , deploymentconfig , rollout |
Default | n/a (depends on app type) |
Notes | The appkind in the spec specifies the Kubernetes resource type of the app deployment. The Litmus ChaosOperator supports chaos on deployments, statefulsets and daemonsets. Application health check routines are dependent on the resource types, in case of some experiments. It is optional for the infra chaos |
Application Under Test
It defines the appns
, applabel
, and appkind
to set the namespace, labels, and kind of the application under test.
appkind
: It supportsdeployment
,statefulset
,daemonset
,deploymentconfig
, androllout
. It is mandatory for the pod-level experiments and optional for the rest of the experiments.
Use the following example to tune this:
# contains details of the AUT(application under test)
# appns: name of the application
# applabel: label of the applicaton
# appkind: kind of the application. supports: deployment, statefulset, daemonset, rollout, deploymentconfig
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
# AUT details
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
RBAC Specifications
It specifies the name of the serviceaccount mapped to a role/clusterRole with enough permissions to execute the desired chaos experiment. The minimum permissions needed for any given experiment are provided in the .spec.definition.permissions field of the respective chaosexperiment CR. It can be tuned via chaosServiceAccount field.
Field | .spec.chaosServiceAccount |
---|---|
Description | Flag to specify serviceaccount used for chaos experiment |
Type | Mandatory |
Range | user-defined (type: string) |
Default | n/a |
Notes | The chaosServiceAccount in the spec specifies the name of the serviceaccount mapped to a role/clusterRole with enough permissions to execute the desired chaos experiment. The minimum permissions needed for any given experiment is provided in the .spec.definition.permissions field of the respective chaosexperiment CR. |
Use the following example to tune this:
# contains name of the serviceAccount which contains all the RBAC permissions required for the experiment
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
# name of the service account w/ sufficient permissions
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
Runtime Specifications
It contains runtime details of the chaos experiments provided at .spec
inside chaosengine.
Field | .spec.terminationGracePeriodSeconds |
---|---|
Description | Flag to control terminationGracePeriodSeconds for the chaos pods(abort case) |
Type | Optional |
Range | integer value |
Default | 30 |
Notes | The terminationGracePeriodSeconds in the spec controls the terminationGracePeriodSeconds for the chaos resources in abort case. Chaos pods contains chaos revert upon abortion steps, which continuously looking for the termination signals. The terminationGracePeriodSeconds should be provided in such a way that the chaos pods got enough time for the revert before completely terminated. |
Field | .spec.jobCleanUpPolicy |
---|---|
Description | Flag to control cleanup of chaos experiment job post execution of chaos |
Type | Optional |
Range | delete , retain |
Default | delete |
Notes | The jobCleanUpPolicy controls whether the experiment pods are removed once execution completes. Set to retain for debug purposes (in the absence of standard logging mechanisms). |
Jobcleanup Policy
It controls whether the experiment pods are removed once execution completes. Set to retain
for debug purposes (in the absence of standard logging mechanisms).
It can be tuned via jobCleanUpPolicy
fields. It supports retain
and delete
. The default value is retain
.
Use the following example to tune this:
# flag to delete or retain the chaos resources after completions of chaosengine
# supports: delete, retain. default: retain
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
jobCleanUpPolicy: "delete"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
Termination Grace Period Seconds
It controls the terminationGracePeriodSeconds
for the chaos resources in the abort case. Chaos pods contain chaos revert upon abortion steps, which continuously looking for the termination signals. The terminationGracePeriodSeconds
should be provided in such a way that the chaos pods got enough time for the revert before being completely terminated.
It can be tuned via terminationGracePeriodSeconds
field.
Use the following example to tune this:
# contains flag to control the terminationGracePeriodSeconds for the chaos pod(abort case)
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
# contains terminationGracePeriodSeconds for the chaos pods
terminationGracePeriodSeconds: 100
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
Runner Specifications
It contains all the chaos-runner tunables provided at .spec.components.runner
inside chaosengine.
Field | .spec.components.runner.image |
---|---|
Description | Flag to specify image of ChaosRunner pod |
Type | Optional |
Range | user-defined (type: string) |
Default | n/a (refer Notes) |
Notes | The .components.runner.image allows developers to specify their own debug runner images. Defaults for the runner image can be enforced via the operator env CHAOS_RUNNER_IMAGE |
Field | .spec.components.runner.imagePullPolicy |
---|---|
Description | Flag to specify imagePullPolicy for the ChaosRunner |
Type | Optional |
Range | Always , IfNotPresent |
Default | IfNotPresent |
Notes | The .components.runner.imagePullPolicy allows developers to specify the pull policy for chaos-runner. Set to Always during debug/test. |
Field | .spec.components.runner.imagePullSecrets |
---|---|
Description | Flag to specify imagePullSecrets for the ChaosRunner |
Type | Optional |
Range | user-defined (type: []corev1.LocalObjectReference) |
Default | n/a |
Notes | The .components.runner.imagePullSecrets allows developers to specify the imagePullSecret name for ChaosRunner. |
Field | .spec.components.runner.runnerAnnotations |
---|---|
Description | Annotations that needs to be provided in the pod which will be created (runner-pod) |
Type | Optional |
Range | user-defined (type: map[string]string) |
Default | n/a |
Notes | The .components.runner.runnerAnnotation allows developers to specify the custom annotations for the runner pod. |
Field | .spec.components.runner.args |
---|---|
Description | Specify the args for the ChaosRunner Pod |
Type | Optional |
Range | user-defined (type: []string) |
Default | n/a |
Notes | The .components.runner.args allows developers to specify their own debug runner args. |
Field | .spec.components.runner.command |
---|---|
Description | Specify the commands for the ChaosRunner Pod |
Type | Optional |
Range | user-defined (type: []string) |
Default | n/a |
Notes | The .components.runner.command allows developers to specify their own debug runner commands. |
Field | .spec.components.runner.configMaps |
---|---|
Description | Configmaps passed to the chaos runner pod |
Type | Optional |
Range | user-defined |
Default | n/a |
Notes | The .spec.components.runner.configMaps provides for a means to insert config information into the runner pod. |
Field | .spec.components.runner.secrets |
---|---|
Description | Kubernetes secrets passed to the chaos runner pod. |
Type | Optional |
Range | user-defined |
Default | n/a |
Notes | The .spec.components.runner.secrets provides for a means to push secrets (typically project ids, access credentials etc.,) into the chaos runner pod. These are especially useful in case of platform-level/infra-level chaos experiments. |
Field | .spec.components.runner.nodeSelector |
---|---|
Description | Node selectors for the runner pod |
Type | Optional |
Range | Labels in the from of label key=value |
Default | n/a |
Notes | The .spec.components.runner.nodeSelector The nodeselector contains labels of the node on which runner pod should be scheduled. Typically used in case of infra/node level chaos. |
Field | .spec.components.runner.resources |
---|---|
Description | Specify the resource requirements for the ChaosRunner pod |
Type | Optional |
Range | user-defined (type: corev1.ResourceRequirements) |
Default | n/a |
Notes | The .spec.components.runner.resources contains the resource requirements for the ChaosRunner Pod, where we can provide resource requests and limits for the pod. |
Field | .spec.components.runner.tolerations |
---|---|
Description | Toleration for the runner pod |
Type | Optional |
Range | user-defined (type: []corev1.Toleration) |
Default | n/a |
Notes | The .spec.components.runner.tolerations Provides tolerations for the runner pod so that it can be scheduled on the respective tainted node. Typically used in case of infra/node level chaos. |
ChaosRunner Annotations
It allows developers to specify the custom annotations for the runner pod. It can be tuned via runnerAnnotations
field.
Use the following example to tune this:
# contains annotations for the chaos runner pod
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
runner:
# annotations for the chaos-runner
runnerAnnotations:
name: chaos-runner
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
ChaosRunner Args And Command
It defines the args
and command
to set the args and command of the chaos-runner respectively.
args
: It allows developers to specify their own debug runner args.command
: It allows developers to specify their own debug runner commands.
Use the following example to tune this:
# contains args and command for the chaos runner
# it will be useful for the cases where custom image of the chaos-runner is used, which supports args and commands
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
# override the args and command for the chaos-runner
runner:
# name of the custom image
image: "<your repo>/chaos-runner:ci"
# args for the image
args:
- "/bin/sh"
# command for the image
command:
- "-c"
- "<custom-command>"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
ChaosRunner Configmaps And Secrets
It defines the configMaps
and secrets
to set the configmaps and secrets mounted to the chaos-runner respectively.
configMaps
: It provides for a means to insert config information into the runner pod.secrets
: It provides for a means to push secrets (typically project ids, access credentials, etc.,) into the chaos runner pod. These are especially useful in the case of platform-level/infra-level chaos experiments.
Use the following example to tune this:
# contains configmaps and secrets for the chaos-runner
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
runner:
# configmaps details mounted to the runner pod
configMaps:
- name: "configmap-01"
mountPath: "/mnt"
# secrets details mounted to the runner pod
secrets:
- name: "secret-01"
mountPath: "/tmp"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
ChaosRunner Image and ImagePullPolicy
It defines the image
and imagePullPolicy
to set the image and imagePullPolicy for the chaos-runner respectively.
image
: It allows developers to specify their own debug runner images. Defaults for the runner image can be enforced via the operator envCHAOS_RUNNER_IMAGE
.imagePullPolicy
: It allows developers to specify the pull policy for chaos-runner. Set to Always during debug/test.
Use the following example to tune this:
# contains the image and imagePullPolicy of the chaos-runner
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
runner:
# override the image of the chaos-runner
# by default it is used the image based on the litmus version
image: "litmuschaos/chaos-runner:latest"
# imagePullPolicy for the runner image
# supports: Always, IfNotPresent. default: IfNotPresent
imagePullPolicy: "Always"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
ChaosRunner ImagePullSecrets
It allows developers to specify the imagePullSecret name for the ChaosRunner. It can be tuned via imagePullSecrets
field.
Use the following example to tune this:
# contains the imagePullSecrets for the chaos-runner
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
runner:
# secret name for the runner image, if using private registry
imagePullSecrets:
- name: regcred
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
ChaosRunner NodeSelectors
The nodeselector contains labels of the node on which runner pod should be scheduled. Typically used in case of infra/node level chaos. It can be tuned via nodeSelector
field.
Use the following example to tune this:
# contains the node-selector for the chaos-runner
# it will schedule the chaos-runner on the coresponding node with matching labels
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
runner:
# nodeselector for the runner pod
nodeSelector:
context: chaos
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
ChaosRunner Resource Requirements
It contains the resource requirements for the ChaosRunner Pod, where we can provide resource requests and limits for the pod. It can be tuned via resources
field.
Use the following example to tune this:
# contains the resource requirements for the runner pod
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
runner:
# resource requirements for the runner pod
resources:
requests:
cpu: "250m"
memory: "64Mi"
limits:
cpu: "500m"
memory: "128Mi"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
ChaosRunner Tolerations
It provides tolerations for the runner pod so that it can be scheduled on the respective tainted node. Typically used in case of infra/node level chaos. It can be tuned via tolerations
field.
Use the following example to tune this:
# contains the tolerations for the chaos-runner
# it will schedule the chaos-runner on the tainted node
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
components:
runner:
# tolerations for the runner pod
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "Schedule"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
Experiment Specifications
It contains all the experiment tunables provided at .spec.experiments[].spec.components
inside chaosengine.
Field | .spec.experiments[].spec.components.configMaps |
---|---|
Description | Configmaps passed to the chaos experiment |
Type | Optional |
Range | user-defined |
Default | n/a |
Notes | The experiment[].spec.components.configMaps provides for a means to insert config information into the experiment. The configmaps definition is validated for correctness and those specified are checked for availability (in the cluster/namespace) before being mounted into the experiment pods. |
Field | .spec.experiments[].spec.components.secrets |
---|---|
Description | Kubernetes secrets passed to the chaos experiment |
Type | Optional |
Range | user-defined |
Default | n/a |
Notes | The experiment[].spec.components.secrets provides for a means to push secrets (typically project ids, access credentials etc.,) into the experiment pods. These are especially useful in case of platform-level/infra-level chaos experiments. The secrets definition is validated for correctness and those specified are checked for availability (in the cluster/namespace) before being mounted into the experiment pods. |
Field | .spec.experiments[].spec.components.experimentImage |
---|---|
Description | Override the image of the chaos experiment |
Type | Optional |
Range | string |
Default | n/a |
Notes | The experiment[].spec.components.experimentImage overrides the experiment image for the chaoexperiment. |
Field | .spec.experiments[].spec.components.experimentImagePullSecrets |
---|---|
Description | Flag to specify imagePullSecrets for the ChaosExperiment |
Type | Optional |
Range | user-defined (type: []corev1.LocalObjectReference) |
Default | n/a |
Notes | The .components.runner.experimentImagePullSecrets allows developers to specify the imagePullSecret name for ChaosExperiment. |
Field | .spec.experiments[].spec.components.nodeSelector |
---|---|
Description | Provide the node selector for the experiment pod |
Type | Optional |
Range | Labels in the from of label key=value |
Default | n/a |
Notes | The experiment[].spec.components.nodeSelector The nodeselector contains labels of the node on which experiment pod should be scheduled. Typically used in case of infra/node level chaos. |
Field | .spec.experiments[].spec.components.statusCheckTimeouts |
---|---|
Description | Provides the timeout and retry values for the status checks. Defaults to 180s & 90 retries (2s per retry) |
Type | Optional |
Range | It contains values in the form (delay: int, timeout: int) |
Default | delay: 2s and timeout: 180s |
Notes | The experiment[].spec.components.statusCheckTimeouts The statusCheckTimeouts override the status timeouts inside chaosexperiments. It contains timeout & delay in seconds. |
Field | .spec.experiments[].spec.components.resources |
---|---|
Description | Specify the resource requirements for the ChaosExperiment pod |
Type | Optional |
Range | user-defined (type: corev1.ResourceRequirements) |
Default | n/a |
Notes | The experiment[].spec.components.resources contains the resource requirements for the ChaosExperiment Pod, where we can provide resource requests and limits for the pod. |
Field | .spec.experiments[].spec.components.experimentAnnotations |
---|---|
Description | Annotations that needs to be provided in the pod which will be created (experiment-pod) |
Type | Optional |
Range | user-defined (type: label key=value) |
Default | n/a |
Notes | The .spec.components.experimentAnnotation allows developers to specify the custom annotations for the experiment pod. |
Field | .spec.experiments[].spec.components.tolerations |
---|---|
Description | Toleration for the experiment pod |
Type | Optional |
Range | user-defined (type: []corev1.Toleration) |
Default | n/a |
Notes | The .spec.components.tolerations Tolerations for the experiment pod so that it can be scheduled on the respective tainted node. Typically used in case of infra/node level chaos. |
Experiment Annotations
It allows developers to specify the custom annotations for the experiment pod. It can be tuned via experimentAnnotations
field.
Use the following example to tune this:
# contains annotations for the chaos runner pod
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# annotations for the experiment pod
experimentAnnotations:
name: chaos-experiment
Experiment Configmaps And Secrets
It defines the configMaps
and secrets
to set the configmaps and secrets mounted to the experiment pod respectively.
configMaps
: It provides for a means to insert config information into the experiment. The configmaps definition is validated for the correctness and those specified are checked for availability (in the cluster/namespace) before being mounted into the experiment pods.secrets
: It provides for a means to push secrets (typically project ids, access credentials, etc.,) into the experiment pods. These are especially useful in the case of platform-level/infra-level chaos experiments. The secrets definition is validated for the correctness and those specified are checked for availability (in the cluster/namespace) before being mounted into the experiment pods.
Use the following example to tune this:
# contains configmaps and secrets for the experiment pod
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# configmaps details mounted to the experiment pod
configMaps:
- name: "configmap-01"
mountPath: "/mnt"
# secrets details mounted to the experiment pod
secrets:
- name: "secret-01"
mountPath: "/tmp"
Experiment Image
It overrides the experiment image for the chaosexperiment. It allows developers to specify the experiment image. It can be tuned via experimentImage
field.
Use the following example to tune this:
# contains the custom image for the experiment pod
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# override the image of the experiment pod
experimentImage: "litmuschaos/go-runner:ci"
Experiment ImagePullSecrets
It allows developers to specify the imagePullSecret name for ChaosExperiment. It can be tuned via experimentImagePullSecrets
field.
Use the following example to tune this:
# contains the imagePullSecrets for the experiment pod
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# secret name for the experiment image, if using private registry
experimentImagePullSecrets:
- name: regcred
Experiment NodeSelectors
The nodeselector contains labels of the node on which experiment pod should be scheduled. Typically used in case of infra/node level chaos. It can be tuned via nodeSelector
field.
Use the following example to tune this:
# contains the node-selector for the experiment pod
# it will schedule the experiment pod on the coresponding node with matching labels
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# nodeselector for the experiment pod
nodeSelector:
context: chaos
Experiment Resource Requirements
It contains the resource requirements for the ChaosExperiment Pod, where we can provide resource requests and limits for the pod. It can be tuned via resources
field.
Use the following example to tune this:
# contains the resource requirements for the experiment pod
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# resource requirements for the experiment pod
resources:
requests:
cpu: "250m"
memory: "64Mi"
limits:
cpu: "500m"
memory: "128Mi"
Experiment Tolerations
It provides tolerations for the experiment pod so that it can be scheduled on the respective tainted node. Typically used in case of infra/node level chaos. It can be tuned via tolerations
field.
Use the following example to tune this:
# contains the tolerations for the experiment pod
# it will schedule the experiment pod on the tainted node
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# tolerations for the experiment pod
tolerations:
- key: "key1"
operator: "Equal"
value: "value1"
effect: "Schedule"
Experiment Status Check Timeout
It overrides the status timeouts inside chaosexperiments. It contains timeout & delay in seconds. It can be tuned via statusCheckTimeouts
field.
Use the following example to tune this:
# contains status check timeout for the experiment pod
# it will set this timeout as upper bound while checking application status, node status in experiments
apiVersion: litmuschaos.io/v1alpha1
kind: ChaosEngine
metadata:
name: engine-nginx
spec:
engineState: "active"
annotationCheck: "false"
appinfo:
appns: "default"
applabel: "app=nginx"
appkind: "deployment"
chaosServiceAccount: pod-delete-sa
experiments:
- name: pod-delete
spec:
components:
# status check timeout for the experiment pod
statusCheckTimeouts:
delay: 2
timeout: 180