Skip to content

Experiment Specifications

It contains all the experiment tunables provided at .spec.experiments[].spec.components inside chaosengine.

View the experiment specification schema

Field .spec.experiments[].spec.components.configMaps
Description Configmaps passed to the chaos experiment
Type Optional
Range user-defined (type: {name: string, mountPath: string})
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 (type: {name: string, mountPath: string})
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.tolerationsTolerations 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