Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/chaos-mesh/chaos-mesh/llms.txt

Use this file to discover all available pages before exploring further.

KernelChaos allows you to inject faults into the Linux kernel to simulate kernel-level failures such as memory allocation failures, page allocation failures, and bio failures.

API Version and Kind

apiVersion: chaos-mesh.org/v1alpha1
kind: KernelChaos

Metadata

Standard Kubernetes object metadata.
metadata.name
string
required
Name of the KernelChaos resource.
metadata.namespace
string
Namespace of the KernelChaos resource. Defaults to default.

Spec Fields

spec
KernelChaosSpec
required
Defines the behavior of the kernel chaos experiment.

KernelChaosSpec

selector
ContainerSelector
required
Selector for targeting containers. See ContainerSelector in Common Types.Inherits all fields from ContainerSelector (inline), including:
  • Pod selection criteria
  • Mode (one/all/fixed/fixed-percent/random-max-percent)
  • Value (for fixed modes)
  • Container names
failKernRequest
FailKernRequest
required
Defines the kernel injection conditions.
duration
*string
Duration of the chaos action.A duration string with format like "300ms", "1.5h", or "2h45m".Valid time units: ns, us (µs), ms, s, m, h
remoteCluster
string
Name of the remote cluster where the chaos will be deployed. If not specified, chaos is applied to the local cluster.

Status Fields

status
KernelChaosStatus
Current status of the chaos experiment.

KernelChaosStatus

conditions
[]ChaosCondition
Current global conditions. See ChaosStatus in Common Types.
experiment
ExperimentStatus
Last known experiment state including desired phase and container records.

Example

apiVersion: chaos-mesh.org/v1alpha1
kind: KernelChaos
metadata:
  name: kernel-slab-error
  namespace: chaos-mesh
spec:
  mode: one
  selector:
    namespaces:
      - default
    labelSelectors:
      app: nginx
  failKernRequest:
    failtype: 0
    headers:
      - "linux/mmzone.h"
    probability: 10
    times: 100
  duration: "30s"