It contains configuration details provided at `spec.definition` inside chaosexperiment ??? info "View the configuration specification schema"
Field .spec.definition.labels
Description Flag to specify the label for the ChaosPod
Type Optional
Range user-defined (type:map[string]string)
Default n/a
Notes The .spec.definition.labels allow developers to specify the ChaosPod label for an experiment.
Field .spec.definition.securityContext.podSecurityContext
Description Flag to specify security context for ChaosPod
Type Optional
Range user-defined (type:corev1.PodSecurityContext)
Default n/a
Notes The .spec.definition.securityContext.podSecurityContext allows the developers to specify the security context for the ChaosPod which applies to all containers inside the Pod.
Field .spec.definition.securityContext.containerSecurityContext.privileged
Description Flag to specify the security context for the ChaosExperiment pod
Type Optional
Range true, false (type:bool)
Default n/a
Notes The .spec.definition.securityContext.containerSecurityContext.privileged specify the securityContext params to the experiment container.
Field .spec.definition.configMaps
Description Flag to specify the configmap for ChaosPod
Type Optional
Range user-defined
Default n/a
Notes The .spec.definition.configMaps allows the developers to mount the ConfigMap volume into the experiment pod.
Field .spec.definition.secrets
Description Flag to specify the secrets for ChaosPod
Type Optional
Range user-defined
Default n/a
Notes The .spec.definition.secrets specify the secret data to be passed for the ChaosPod. The secrets typically contains confidential information like credentials.
Field .spec.definition.experimentAnnotations
Description Flag to specify the custom annotation to the ChaosPod
Type Optional
Range user-defined (type:map[string]string)
Default n/a
Notes The .spec.definition.experimentAnnotations allows the developer to specify the Custom annotation for the chaos pod.
Field .spec.definition.hostFileVolumes
Description Flag to specify the host file volumes to the ChaosPod
Type Optional
Range user-defined (type:map[string]string)
Default n/a
Notes The .spec.definition.hostFileVolumes allows the developer to specify the host file volumes to the ChaosPod.
Field .spec.definition.hostPID
Description Flag to specify the host PID for the ChaosPod
Type Optional
Range true, false (type:bool)
Default n/a
Notes The .spec.definition.hostPID allows the developer to specify the host PID for the ChaosPod.
## Labels It allows developers to specify the ChaosPod label for an experiment. It can be tuned via `labels` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/labels.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it contains experiment labels labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ``` ## PodSecurityContext It allows the developers to specify the security context for the ChaosPod which applies to all containers inside the Pod. It can be tuned via `podSecurityContext` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/pod-security-context.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it contains pod security context securityContext: podSecurityContext: allowPrivilegeEscalation: true labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ``` ## Container Security Context It allows the developers to specify the security context for the container inside ChaosPod. It can be tuned via `containerSecurityContext` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/container-security-context.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it contains container security context securityContext: containerSecurityContext: privileged: true labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ``` ## ConfigMaps It allows the developers to mount the ConfigMap volume into the experiment pod. It can tuned via `configMaps` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/configmaps.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it contains configmaps details configMaps: - name: experiment-data mountPath: "/mnt" labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ``` ## Secrets It specify the secret data to be passed for the ChaosPod. The secrets typically contains confidential information like credentials. It can be tuned via `secret` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/secrets.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it contains secret details secret: - name: auth-credentials mountPath: "/tmp" labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ``` ## Experiment Annotations It allows the developer to specify the Custom annotation for the chaos pod. It can be tuned via `experimentAnnotations` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/experiment-annotations.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it contains experiment annotations experimentAnnotations: context: chaos labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ``` ## Host File Volumes It allows the developer to specify the host file volumes to the ChaosPod. It can be tuned via `hostFileVolumes` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/host-file-volumes.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it contains host file volumes hostFileVolumes: - name: socket file mountPath: "/run/containerd/containerd.sock" nodePath: "/run/containerd/containerd.sock" labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ``` ## Host PID It allows the developer to specify the host PID for the ChaosPod. It can be tuned via `hostPID` field. Use the following example to tune this: [embedmd]:# (https://raw.githubusercontent.com/litmuschaos/litmus/master/mkdocs/docs/experiments/concepts/chaos-resources/chaos-experiment/experiment-configuration/host-pid.yaml yaml) ```yaml apiVersion: litmuschaos.io/v1alpha1 description: message: | Deletes a pod belonging to a deployment/statefulset/daemonset kind: ChaosExperiment metadata: name: pod-delete labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: chaosexperiment app.kubernetes.io/version: latest spec: definition: scope: Namespaced permissions: - apiGroups: - "" - "apps" - "apps.openshift.io" - "argoproj.io" - "batch" - "litmuschaos.io" resources: - "deployments" - "jobs" - "pods" - "pods/log" - "replicationcontrollers" - "deployments" - "statefulsets" - "daemonsets" - "replicasets" - "deploymentconfigs" - "rollouts" - "pods/exec" - "events" - "chaosengines" - "chaosexperiments" - "chaosresults" verbs: - "create" - "list" - "get" - "patch" - "update" - "delete" - "deletecollection" image: "litmuschaos/go-runner:latest" imagePullPolicy: Always args: - -c - ./experiments -name pod-delete command: - /bin/bash env: - name: TOTAL_CHAOS_DURATION value: '15' - name: RAMP_TIME value: '' - name: FORCE value: 'true' - name: CHAOS_INTERVAL value: '5' - name: PODS_AFFECTED_PERC value: '' - name: LIB value: 'litmus' - name: TARGET_PODS value: '' - name: SEQUENCE value: 'parallel' # it allows hostPID hostPID: true labels: name: pod-delete app.kubernetes.io/part-of: litmus app.kubernetes.io/component: experiment-job app.kubernetes.io/version: latest ```