API Reference

chaos-mesh.org/v1alpha1

Package v1alpha1 contains API Schema definitions for the chaosmesh v1alpha1 API group

AWSChaos

AWSChaos is the Schema for the awschaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

AWSChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

AWSChaosAction (string)

AWSChaosAction represents the chaos action about aws.

Appears In:

AWSChaosSpec

AWSChaosSpec is the content of the specification for an AWSChaos

Appears In:
Field Description

Action defines the specific aws chaos action. Supported action: ec2-stop / ec2-restart / detach-volume Default action: ec2-stop

duration string

Duration represents the duration of the chaos action.

secretName string

SecretName defines the name of kubernetes secret.

AWSSelector AWSSelector

AWSChaosStatus

AWSChaosStatus represents the status of an AWSChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

AWSSelector

Appears In:
Field Description

endpoint string

Endpoint indicates the endpoint of the aws server. Just used it in test now.

awsRegion string

AWSRegion defines the region of aws.

ec2Instance string

Ec2Instance indicates the ID of the ec2 instance.

volumeID string

EbsVolume indicates the ID of the EBS volume. Needed in detach-volume.

deviceName string

DeviceName indicates the name of the device. Needed in detach-volume.

AttrOverrideSpec

AttrOverrideSpec represents an override of attribution

Field Description

ino integer

size integer

blocks integer

atime Timespec

mtime Timespec

ctime Timespec

kind FileType

perm integer

nlink integer

uid integer

gid integer

rdev integer

BandwidthSpec

BandwidthSpec defines detail of bandwidth limit.

Appears In:
Field Description

rate string

Rate is the speed knob. Allows bps, kbps, mbps, gbps, tbps unit. bps means bytes per second.

limit integer

Limit is the number of bytes that can be queued waiting for tokens to become available.

buffer integer

Buffer is the maximum amount of bytes that tokens can be available for instantaneously.

peakrate integer

Peakrate is the maximum depletion rate of the bucket. The peakrate does not need to be set, it is only necessary if perfect millisecond timescale shaping is required.

minburst integer

Minburst specifies the size of the peakrate bucket. For perfect accuracy, should be set to the MTU of the interface. If a peakrate is needed, but some burstiness is acceptable, this size can be raised. A 3000 byte minburst allows around 3mbit/s of peakrate, given 1000 byte packets.

CPUStressor

CPUStressor defines how to stress CPU out

Appears In:
Field Description

Stressor Stressor

load integer

Load specifies P percent loading per CPU worker. 0 is effectively a sleep (no load) and 100 is full loading.

options string array

extend stress-ng options

ChainDirection (string)

ChainDirection represents the direction of chain

Appears In:

ChaosCondition

Appears In:
Field Description

reason string

ChaosConditionType (string)

Appears In:

ChaosOnlyScheduleSpec

ChaosOnlyScheduleSpec is very similar with ScheduleSpec, but it could not schedule Workflow because we could not resolve nested CRD now

Appears In:
Field Description

schedule string

startingDeadlineSeconds integer

concurrencyPolicy ConcurrencyPolicy

historyLimit integer

TODO: use a custom type, as TemplateType contains other possible values

EmbedChaos EmbedChaos

ChaosStatus

Field Description

conditions ChaosCondition array

Conditions represents the current global condition of the chaos

experiment ExperimentStatus

Experiment records the last experiment state.

ClockSpec

Appears In:
Field Description

pid integer

the pid of target program.

time-offset string

specifies the length of time offset.

clock-ids-slice string

the identifier of the particular clock on which to act. More clock description in linux kernel can be found in man page of clock_getres, clock_gettime, clock_settime. Muti clock ids should be split with ","

ConcurrencyPolicy (string)

ConditionalBranch

Field Description

target string

Target is the name of other template, if expression is evaluated as true, this template will be spawned.

expression string

Expression is the expression for this conditional branch, expected type of result is boolean. If expression is empty, this branch will always be selected/the template will be spawned.

ConditionalBranchStatus

Field Description

target string

evaluationResult ConditionStatus

ConditionalBranchesStatus

Appears In:
Field Description

branches ConditionalBranchStatus array

context string array

ContainerSelector

Field Description

PodSelector PodSelector

containerNames string array

ContainerNames indicates list of the name of affected container. If not set, all containers will be injected

CorruptSpec

CorruptSpec defines detail of a corrupt action

Appears In:
Field Description

corrupt string

correlation string

DNSChaos

DNSChaos is the Schema for the networkchaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

DNSChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a pod chaos experiment

Most recently observed status of the chaos experiment about pods

DNSChaosSpec

DNSChaosSpec defines the desired state of DNSChaos

Appears In:
Field Description

action DNSChaosAction

Action defines the specific DNS chaos action. Supported action: error, random Default action: error

ContainerSelector ContainerSelector

duration string

Duration represents the duration of the chaos action

patterns string array

Choose which domain names to take effect, support the placeholder ? and wildcard , or the Specified domain name. Note: 1. The wildcard * must be at the end of the string. For example, chaos-.org is invalid. 2. if the patterns is empty, will take effect on all the domain names. For example: The value is ["google.com", "github.*", "chaos-mes?.org"], will take effect on "google.com", "github.com" and "chaos-mesh.org"

DNSChaosStatus

DNSChaosStatus defines the observed state of DNSChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

DelaySpec

DelaySpec defines detail of a delay action

Appears In:
Field Description

latency string

correlation string

jitter string

reorder ReorderSpec

DesiredPhase (string)

Appears In:

Direction (string)

Direction represents traffic direction from source to target, it could be netem, delay, loss, duplicate, corrupt or partition, check comments below for detail direction flow.

Appears In:

DiskFileSpec

Field Description

size string

specifies how many units of data will write into the file path. support unit: c=1, w=2, b=512, kB=1000, K=1024, MB=1000*1000, M=1024*1024, GB=1000*1000*1000, G=1024*1024*1024 BYTES. example : 1M

512kB

path string

DiskFillSpec

Appears In:
Field Description

DiskFileSpec DiskFileSpec

fill-by-fallocate boolean

fill disk by fallocate

DiskPayloadSpec

Appears In:
Field Description

DiskFileSpec DiskFileSpec

payload-process-num integer

specifies the number of process work on writing, default 1, only 1-255 is valid value

DuplicateSpec

DuplicateSpec defines detail of a duplicate action

Appears In:
Field Description

duplicate string

correlation string

EmbedChaos

Field Description

awsChaos AWSChaosSpec

dnsChaos DNSChaosSpec

gcpChaos GCPChaosSpec

httpChaos HTTPChaosSpec

ioChaos IOChaosSpec

jvmChaos JVMChaosSpec

kernelChaos KernelChaosSpec

networkChaos NetworkChaosSpec

physicalmachineChaos PhysicalMachineChaosSpec

podChaos PodChaosSpec

stressChaos StressChaosSpec

timeChaos TimeChaosSpec

ExpInfo

Field Description

uid string

the experiment ID

action string

the subAction, generate automatically

stress-cpu StressCPUSpec

stress-mem StressMemorySpec

disk-read-payload DiskPayloadSpec

disk-write-payload DiskPayloadSpec

disk-fill DiskFillSpec

network-corrupt NetworkCorruptSpec

network-duplicate NetworkDuplicateSpec

network-loss NetworkLossSpec

network-delay NetworkDelaySpec

network-partition NetworkPartitionSpec

network-dns NetworkDNSSpec

network-bandwidth NetworkBandwidthSpec

process ProcessSpec

jvm-exception JVMExceptionSpec

jvm-gc JVMGCSpec

jvm-latency JVMLatencySpec

jvm-return JVMReturnSpec

jvm-stress JVMStressSpec

jvm-rule-data JVMRuleDataSpec

clock ClockSpec

ExperimentStatus

Appears In:
Field Description

desiredPhase DesiredPhase

containerRecords Record array

Records are used to track the running status

FailKernRequest

FailKernRequest defines the injection conditions

Appears In:
Field Description

failtype integer

FailType indicates what to fail, can be set to '0' / '1' / '2' If 0, indicates slab to fail (should_failslab) If 1, indicates alloc_page to fail (should_fail_alloc_page) If 2, indicates bio to fail (should_fail_bio) You can read: 1. https://www.kernel.org/doc/html/latest/fault-injection/fault-injection.html 2. http://github.com/iovisor/bcc/blob/master/tools/inject_example.txt to learn more

headers string array

Headers indicates the appropriate kernel headers you need. Eg: "linux/mmzone.h", "linux/blkdev.h" and so on

callchain Frame array

Callchain indicate a special call chain, such as: ext4_mount → mount_subtree → …​ → should_failslab With an optional set of predicates and an optional set of parameters, which used with predicates. You can read call chan and predicate examples from https://github.com/chaos-mesh/bpfki/tree/develop/examples to learn more. If no special call chain, just keep Callchain empty, which means it will fail at any call chain with slab alloc (eg: kmalloc).

probability integer

Probability indicates the fails with probability. If you want 1%, please set this field with 1.

times integer

Times indicates the max times of fails.

FileType (string)

FileType represents type of file

Appears In:

FillingType (string)

FillingType represents type of data is filled for incorrectness

Appears In:

Filter

Filter represents a filter of IOChaos action, which will define the scope of an IOChaosAction

Appears In:
Field Description

path string

Path represents a glob of injecting path

methods IoMethod

Methods represents the method that the action will inject in

percent integer

Percent represents the percent probability of injecting this action

Frame

Frame defines the function signature and predicate in function’s body

Appears In:
Field Description

funcname string

Funcname can be find from kernel source or /proc/kallsyms, such as ext4_mount

parameters string

Parameters is used with predicate, for example, if you want to inject slab error in d_alloc_parallel(struct dentry *parent, const struct qstr *name) with a special name bananas, you need to set it to struct dentry *parent, const struct qstr *name otherwise omit it.

predicate string

Predicate will access the arguments of this Frame, example with Parameters’s, you can set it to STRNCMP(name→name, "bananas", 8) to make inject only with it, or omit it to inject for all d_alloc_parallel call chain.

GCPChaos

GCPChaos is the Schema for the gcpchaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

GCPChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

GCPChaosAction (string)

GCPChaosAction represents the chaos action about gcp.

Appears In:

GCPChaosSpec

GCPChaosSpec is the content of the specification for a GCPChaos

Appears In:
Field Description

Action defines the specific gcp chaos action. Supported action: node-stop / node-reset / disk-loss Default action: node-stop

duration string

Duration represents the duration of the chaos action.

secretName string

SecretName defines the name of kubernetes secret. It is used for GCP credentials.

GCPSelector GCPSelector

GCPChaosStatus

GCPChaosStatus represents the status of a GCPChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

attachedDiskStrings string array

The attached disk info strings. Needed in disk-loss.

GCPSelector

Appears In:
Field Description

project string

Project defines the ID of gcp project.

zone string

Zone defines the zone of gcp project.

instance string

Instance defines the name of the instance

deviceNames string array

The device name of disks to detach. Needed in disk-loss.

GenericSelectorSpec

GenericSelectorSpec defines some selectors to select objects.

Appears In:
Field Description

namespaces string array

Namespaces is a set of namespace to which objects belong.

fieldSelectors object (keys:string, values:string)

Map of string keys and values that can be used to select objects. A selector based on fields.

labelSelectors object (keys:string, values:string)

Map of string keys and values that can be used to select objects. A selector based on labels.

expressionSelectors LabelSelectorRequirement array

a slice of label selector expressions that can be used to select objects. A list of selectors based on set-based label expressions.

annotationSelectors object (keys:string, values:string)

Map of string keys and values that can be used to select objects. A selector based on annotations.

HTTPChaos

HTTPChaos is the Schema for the HTTPchaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

HTTPChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

HTTPChaosSpec

Appears In:
Field Description

PodSelector PodSelector

Target is the object to be selected and injected.

PodHttpChaosActions PodHttpChaosActions

port integer

Port represents the target port to be proxy of.

path string

Path is a rule to select target by uri path in http request.

method string

Method is a rule to select target by http method in request.

code integer

Code is a rule to select target by http status code in response.

request_headers object (keys:string, values:string)

RequestHeaders is a rule to select target by http headers in request. The key-value pairs represent header name and header value pairs.

response_headers object (keys:string, values:string)

ResponseHeaders is a rule to select target by http headers in response. The key-value pairs represent header name and header value pairs.

duration string

Duration represents the duration of the chaos action.

HTTPChaosStatus

Appears In:
Field Description

ChaosStatus ChaosStatus

instances object (keys:string, values:integer)

Instances always specifies podhttpchaos generation or empty

IOChaos

IOChaos is the Schema for the iochaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

IOChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

status IOChaosStatus

IOChaosAction

IOChaosAction defines a possible action of IOChaos

Appears In:
Field Description

Filter Filter

faults IoFault array

Faults represents the fault to inject

latency string

Latency represents the latency to inject

AttrOverrideSpec AttrOverrideSpec

AttrOverride represents the attribution to override

mistake MistakeSpec

MistakeSpec represents the mistake to inject

source string

Source represents the source of current rules

IOChaosSpec

IOChaosSpec defines the desired state of IOChaos

Appears In:
Field Description

ContainerSelector ContainerSelector

action IOChaosType

Action defines the specific pod chaos action. Supported action: latency / fault / attrOverride / mistake

delay string

Delay defines the value of I/O chaos action delay. A delay string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

errno integer

Errno defines the error code that returned by I/O action. refer to: https://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html

Attr defines the overrided attribution

mistake MistakeSpec

Mistake defines what types of incorrectness are injected to IO operations

path string

Path defines the path of files for injecting I/O chaos action.

methods IoMethod array

Methods defines the I/O methods for injecting I/O chaos action. default: all I/O methods.

percent integer

Percent defines the percentage of injection errors and provides a number from 0-100. default: 100.

volumePath string

VolumePath represents the mount path of injected volume

duration string

Duration represents the duration of the chaos action. It is required when the action is PodFailureAction. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

IOChaosStatus

IOChaosStatus defines the observed state of IOChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

instances object (keys:string, values:integer)

Instances always specifies podiochaos generation or empty

IOChaosType (string)

IOChaosType represents the type of IOChaos Action

IoFault

IoFault represents the fault to inject and their weight

Appears In:
Field Description

errno integer

weight integer

IoMethod (string)

Appears In:

JVMChaos

JVMChaos is the Schema for the jvmchaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

JVMChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

JVMChaosAction (string)

JVMChaosAction represents the chaos action about jvm

Appears In:

JVMChaosSpec

JVMChaosSpec defines the desired state of JVMChaos

Appears In:
Field Description

ContainerSelector ContainerSelector

duration string

Duration represents the duration of the chaos action

Action defines the specific jvm chaos action. Supported action: latency;return;exception;stress;gc;ruleData

JVMParameter JVMParameter

JVMParameter represents the detail about jvm chaos action definition

JVMChaosStatus

JVMChaosStatus defines the observed state of JVMChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

JVMClassMethodSpec

Field Description

class string

Java class

method string

the method in Java class

JVMCommonSpec

Field Description

port integer

the port of agent server

pid integer

the pid of Java process which need to attach

JVMExceptionSpec

Appears In:
Field Description

JVMCommonSpec JVMCommonSpec

JVMClassMethodSpec JVMClassMethodSpec

exception string

the exception which needs to throw for action exception

JVMGCSpec

Appears In:
Field Description

JVMCommonSpec JVMCommonSpec

JVMLatencySpec

Appears In:
Field Description

JVMCommonSpec JVMCommonSpec

JVMClassMethodSpec JVMClassMethodSpec

latency integer

the latency duration for action 'latency', unit ms

JVMParameter

JVMParameter represents the detail about jvm chaos action definition

Appears In:
Field Description

name string

byteman rule name, should be unique, and will use JVMChaos' name if not set

class string

Java class

method string

the method in Java class

value string

the return value for action 'return'

exception string

the exception which needs to throw for action exception

latency integer

the latency duration for action 'latency', unit ms

cpuCount integer

the CPU core number need to use, only set it when action is stress

memType string

the memory type need to locate, only set it when action is stress, the value can be 'stack' or 'heap'

port integer

the port of agent server, default 9277

ruleData string

JVMReturnSpec

Appears In:
Field Description

JVMCommonSpec JVMCommonSpec

JVMClassMethodSpec JVMClassMethodSpec

value string

the return value for action 'return'

JVMRuleDataSpec

Appears In:
Field Description

JVMCommonSpec JVMCommonSpec

rule-data string

RuleData used to save the rule file’s data, will use it when recover

JVMStressSpec

Appears In:
Field Description

JVMCommonSpec JVMCommonSpec

cpu-count integer

the CPU core number need to use, only set it when action is stress

mem-type string

the memory type need to locate, only set it when action is stress, the value can be 'stack' or 'heap'

KernelChaos

KernelChaos is the Schema for the kernelchaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

KernelChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a kernel chaos experiment

Most recently observed status of the kernel chaos experiment

KernelChaosSpec

KernelChaosSpec defines the desired state of KernelChaos

Appears In:
Field Description

PodSelector PodSelector

failKernRequest FailKernRequest

FailKernRequest defines the request of kernel injection

duration string

Duration represents the duration of the chaos action

KernelChaosStatus

KernelChaosStatus defines the observed state of KernelChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

LossSpec

LossSpec defines detail of a loss action

Appears In:
Field Description

loss string

correlation string

MemoryStressor

MemoryStressor defines how to stress memory out

Appears In:
Field Description

Stressor Stressor

size string

Size specifies N bytes consumed per vm worker, default is the total available memory. One can specify the size as % of total available memory or in units of B, KB/KiB, MB/MiB, GB/GiB, TB/TiB.

options string array

extend stress-ng options

MistakeSpec

MistakeSpec represents one type of mistake

Field Description

filling FillingType

Filling determines what is filled in the mistake data.

maxOccurrences integer

There will be [1, MaxOccurrences] segments of wrong data.

maxLength integer

Max length of each wrong data segment in bytes

NetworkBandwidthSpec

Appears In:
Field Description

rate string

limit integer

buffer integer

peakrate integer

minburst integer

device string

ip-address string

hostname string

NetworkChaos

NetworkChaos is the Schema for the networkchaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

NetworkChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a pod chaos experiment

Most recently observed status of the chaos experiment about pods

NetworkChaosAction (string)

NetworkChaosAction represents the chaos action about network.

Appears In:

NetworkChaosSpec

NetworkChaosSpec defines the desired state of NetworkChaos

Appears In:
Field Description

PodSelector PodSelector

Action defines the specific network chaos action. Supported action: partition, netem, delay, loss, duplicate, corrupt Default action: delay

device string

Device represents the network device to be affected.

duration string

Duration represents the duration of the chaos action

TcParameter TcParameter

TcParameter represents the traffic control definition

direction Direction

Direction represents the direction, this applies on netem and network partition action

target PodSelector

Target represents network target, this applies on netem and network partition action

targetDevice string

TargetDevice represents the network device to be affected in target scope.

externalTargets string array

ExternalTargets represents network targets outside k8s

NetworkChaosStatus

NetworkChaosStatus defines the observed state of NetworkChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

instances object (keys:string, values:integer)

Instances always specifies podnetworkchaos generation or empty

NetworkCommonSpec

Field Description

correlation string

correlation is percentage (10 is 10%)

device string

the network interface to impact

source-port string

only impact egress traffic from these source ports, use a ',' to separate or to indicate the range, such as 80, 8001:8010. it can only be used in conjunction with -p tcp or -p udp

egress-port string

only impact egress traffic to these destination ports, use a ',' to separate or to indicate the range, such as 80, 8001:8010. it can only be used in conjunction with -p tcp or -p udp

ip-address string

only impact egress traffic to these IP addresses

ip-protocol string

only impact traffic using this IP protocol, supported: tcp, udp, icmp, all

hostname string

only impact traffic to these hostnames

NetworkCorruptSpec

Appears In:
Field Description

NetworkCommonSpec NetworkCommonSpec

percent string

percentage of packets to corrupt (10 is 10%)

NetworkDNSSpec

Appears In:
Field Description

dns-server string

update the DNS server in /etc/resolv.conf with this value

dns-ip string

map specified host to this IP address

dns-domain-name string

map this host to specified IP

NetworkDelaySpec

Appears In:
Field Description

NetworkCommonSpec NetworkCommonSpec

jitter string

jitter time, time units: ns, us (or µs), ms, s, m, h.

latency string

delay egress time, time units: ns, us (or µs), ms, s, m, h.

NetworkDuplicateSpec

Appears In:
Field Description

NetworkCommonSpec NetworkCommonSpec

percent string

percentage of packets to duplicate (10 is 10%)

NetworkLossSpec

Appears In:
Field Description

NetworkCommonSpec NetworkCommonSpec

percent string

percentage of packets to loss (10 is 10%)

NetworkPartitionSpec

Appears In:
Field Description

device string

the network interface to impact

hostname string

only impact traffic to these hostnames

ip-address string

only impact egress traffic to these IP addresses

direction string

specifies the partition direction, values can be 'from', 'to'. 'from' means packets coming from the 'IPAddress' or 'Hostname' and going to your server, 'to' means packets originating from your server and going to the 'IPAddress' or 'Hostname'.

ip-protocol string

only impact egress traffic to these IP addresses

accept-tcp-flags string

only the packet which match the tcp flag can be accepted, others will be dropped. only set when the IPProtocol is tcp, used for partition.

Phase (string)

Appears In:

PhysicalMachineChaos

PhysicalMachineChaos is the Schema for the physical machine chaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

PhysicalMachineChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a physical machine chaos experiment

Most recently observed status of the chaos experiment

PhysicalMachineChaosSpec

PhysicalMachineChaosSpec defines the desired state of PhysicalMachineChaos

Field Description

action PhysicalMachineChaosAction

PhysicalMachineSelector PhysicalMachineSelector

ExpInfo ExpInfo

ExpInfo string json:"expInfo"

duration string

Duration represents the duration of the chaos action

PhysicalMachineChaosStatus

PhysicalMachineChaosStatus defines the observed state of PhysicalMachineChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

PhysicalMachineSelector

Field Description

address string array

PodChaos

PodChaos is the control script`s spec.

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

PodChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a pod chaos experiment

Most recently observed status of the chaos experiment about pods

PodChaosAction (string)

PodChaosAction represents the chaos action about pods.

Appears In:

PodChaosSpec

PodChaosSpec defines the attributes that a user creates on a chaos experiment about pods.

Appears In:
Field Description

ContainerSelector ContainerSelector

Action defines the specific pod chaos action. Supported action: pod-kill / pod-failure / container-kill Default action: pod-kill

duration string

Duration represents the duration of the chaos action. It is required when the action is PodFailureAction. A duration string is a possibly signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

gracePeriod integer

GracePeriod is used in pod-kill action. It represents the duration in seconds before the pod should be deleted. Value must be non-negative integer. The default value is zero that indicates delete immediately.

PodChaosStatus

PodChaosStatus represents the current status of the chaos experiment about pods.

Appears In:
Field Description

ChaosStatus ChaosStatus

PodHttpChaos

PodHttpChaos is the Schema for the podhttpchaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

PodHttpChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

PodHttpChaosActions

PodHttpChaosAction defines possible actions of HttpChaos.

Field Description

abort boolean

Abort is a rule to abort a http session.

delay string

Delay represents the delay of the target request/response. A duration string is a possibly unsigned sequence of decimal numbers, each with optional fraction and a unit suffix, such as "300ms", "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

Replace is a rule to replace some contents in target.

Patch is a rule to patch some contents in target.

PodHttpChaosBaseRule

PodHttpChaosBaseRule defines the injection rule without source and port.

Appears In:
Field Description

Target is the object to be selected and injected, <Request

Response>.

Selector contains the rules to select target.

PodHttpChaosPatchActions

PodHttpChaosPatchActions defines possible patch-actions of HttpChaos.

Appears In:
Field Description

Body is a rule to patch message body of target.

queries string array array

Queries is a rule to append uri queries of target(Request only). For example: [["foo", "bar"], ["foo", "unknown"]].

headers string array array

Headers is a rule to append http headers of target. For example: [["Set-Cookie", "<one cookie>"], ["Set-Cookie", "<another cookie>"]].

PodHttpChaosPatchBodyAction

PodHttpChaosPatchBodyAction defines patch body action of HttpChaos.

Field Description

type string

Type represents the patch type, only support JSON as [merge patch json](https://tools.ietf.org/html/rfc7396) currently.

value string

Value is the patch contents.

PodHttpChaosReplaceActions

PodHttpChaosReplaceActions defines possible replace-actions of HttpChaos.

Appears In:
Field Description

path string

Path is rule to to replace uri path in http request.

method string

Method is a rule to replace http method in request.

code integer

Code is a rule to replace http status code in response.

body integer array

Body is a rule to replace http message body in target.

queries object (keys:string, values:string)

Queries is a rule to replace uri queries in http request. For example, with value { "foo": "unknown" }, the /?foo=bar will be altered to /?foo=unknown,

headers object (keys:string, values:string)

Headers is a rule to replace http headers of target. The key-value pairs represent header name and header value pairs.

PodHttpChaosRule

PodHttpChaosRule defines the injection rule for http.

Appears In:
Field Description

PodHttpChaosBaseRule PodHttpChaosBaseRule

source string

Source represents the source of current rules

port integer

Port represents the target port to be proxy of.

PodHttpChaosSelector

Appears In:
Field Description

port integer

Port is a rule to select server listening on specific port.

path string

Path is a rule to select target by uri path in http request.

method string

Method is a rule to select target by http method in request.

code integer

Code is a rule to select target by http status code in response.

request_headers object (keys:string, values:string)

RequestHeaders is a rule to select target by http headers in request. The key-value pairs represent header name and header value pairs.

response_headers object (keys:string, values:string)

ResponseHeaders is a rule to select target by http headers in response. The key-value pairs represent header name and header value pairs.

PodHttpChaosSpec

PodHttpChaosSpec defines the desired state of PodHttpChaos.

Appears In:
Field Description

rules PodHttpChaosRule array

Rules are a list of injection rule for http request.

PodHttpChaosStatus

PodHttpChaosStatus defines the actual state of PodHttpChaos.

Appears In:
Field Description

pid integer

Pid represents a running tproxy process id.

startTime integer

StartTime represents the start time of a tproxy process.

failedMessage string

observedGeneration integer

PodHttpChaosTarget (string)

PodHttpChaosTarget represents the type of an HttpChaos Action

PodIOChaos

PodIOChaos is the Schema for the podiochaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

PodIOChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

PodIOChaosSpec

PodIOChaosSpec defines the desired state of IOChaos

Appears In:
Field Description

volumeMountPath string

VolumeMountPath represents the target mount path It must be a root of mount path now. TODO: search the mount parent of any path automatically. TODO: support multiple different volume mount path in one pod

container string

TODO: support multiple different container to inject in one pod

actions IOChaosAction array

Actions are a list of IOChaos actions

PodIOChaosStatus

Appears In:
Field Description

pid integer

Pid represents a running toda process id

startTime integer

StartTime represents the start time of a toda process

failedMessage string

observedGeneration integer

PodNetworkChaos

PodNetworkChaos is the Schema for the PodNetworkChaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

PodNetworkChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a pod chaos experiment

Most recently observed status of the chaos experiment about pods

PodNetworkChaosSpec

PodNetworkChaosSpec defines the desired state of PodNetworkChaos

Appears In:
Field Description

ipsets RawIPSet array

The ipset on the pod

iptables RawIptables array

The iptables rules on the pod

tcs RawTrafficControl array

The tc rules on the pod

PodNetworkChaosStatus

PodNetworkChaosStatus defines the observed state of PodNetworkChaos

Appears In:
Field Description

failedMessage string

observedGeneration integer

PodSelector

Field Description

selector PodSelectorSpec

Selector is used to select pods that are used to inject chaos action.

Mode defines the mode to run chaos action. Supported mode: one / all / fixed / fixed-percent / random-max-percent

value string

Value is required when the mode is set to FixedMode / FixedPercentMode / RandomMaxPercentMode. If FixedMode, provide an integer of pods to do chaos action. If FixedPercentMode, provide a number from 0-100 to specify the percent of pods the server can do chaos action. IF RandomMaxPercentMode, provide a number from 0-100 to specify the max percent of pods to do chaos action

PodSelectorSpec

PodSelectorSpec defines the some selectors to select objects. If the all selectors are empty, all objects will be used in chaos experiment.

Appears In:
Field Description

GenericSelectorSpec GenericSelectorSpec

nodes string array

Nodes is a set of node name and objects must belong to these nodes.

pods object (keys:string, values:string array)

Pods is a map of string keys and a set values that used to select pods. The key defines the namespace which pods belong, and the each values is a set of pod names.

nodeSelectors object (keys:string, values:string)

Map of string keys and values that can be used to select nodes. Selector which must match a node’s labels, and objects must belong to these selected nodes.

podPhaseSelectors string array

PodPhaseSelectors is a set of condition of a pod at the current time. supported value: Pending / Running / Succeeded / Failed / Unknown

ProcessSpec

Appears In:
Field Description

process string

the process name or the process ID

signal integer

the signal number to send

RawIPSet

RawIPSet represents an ipset on specific pod

Appears In:
Field Description

name string

The name of ipset

cidrs string array

The contents of ipset

RawRuleSource RawRuleSource

The name and namespace of the source network chaos

RawIptables

RawIptables represents the iptables rules on specific pod

Appears In:
Field Description

name string

The name of iptables chain

ipsets string array

The name of related ipset

direction ChainDirection

The block direction of this iptables rule

device string

Device represents the network device to be affected.

RawRuleSource RawRuleSource

RawRuleSource

RawRuleSource represents the name and namespace of the source network chaos

Appears In:
Field Description

source string

RawTrafficControl

RawTrafficControl represents the traffic control chaos on specific pod

Appears In:
Field Description

type TcType

The type of traffic control

TcParameter TcParameter

ipset string

The name of target ipset

source string

The name and namespace of the source network chaos

device string

Device represents the network device to be affected.

Record

Appears In:
Field Description

id string

selectorKey string

phase Phase

ReorderSpec

ReorderSpec defines details of packet reorder.

Appears In:
Field Description

reorder string

correlation string

gap integer

Schedule

Schedule is the cronly schedule object

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

Schedule

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

ScheduleItem

Appears In:
Field Description

EmbedChaos EmbedChaos

workflow WorkflowSpec

ScheduleSpec

ScheduleSpec is the specification of a schedule object

Field Description

schedule string

startingDeadlineSeconds integer

concurrencyPolicy ConcurrencyPolicy

historyLimit integer

TODO: use a custom type, as TemplateType contains other possible values

ScheduleItem ScheduleItem

ScheduleStatus

ScheduleStatus is the status of a schedule object

Appears In:
Field Description

active ObjectReference array

time Time

ScheduleTemplateType (string)

SelectorMode (string)

SelectorMode represents the mode to run chaos action.

Appears In:

StressCPUSpec

Appears In:
Field Description

load integer

specifies P percent loading per CPU worker. 0 is effectively a sleep (no load) and 100 is full loading.

workers integer

specifies N workers to apply the stressor.

options string

extend stress-ng options

StressChaos

StressChaos is the Schema for the stresschaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

StressChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a time chaos experiment

Most recently observed status of the time chaos experiment

StressChaosSpec

StressChaosSpec defines the desired state of StressChaos

Appears In:
Field Description

ContainerSelector ContainerSelector

stressors Stressors

Stressors defines plenty of stressors supported to stress system components out. You can use one or more of them to make up various kinds of stresses. At least one of the stressors should be specified.

stressngStressors string

StressngStressors defines plenty of stressors just like Stressors except that it’s an experimental feature and more powerful. You can define stressors in stress-ng (see also man stress-ng) dialect, however not all of the supported stressors are well tested. It maybe retired in later releases. You should always use Stressors to define the stressors and use this only when you want more stressors unsupported by Stressors. When both StressngStressors and Stressors are defined, StressngStressors wins.

duration string

Duration represents the duration of the chaos action

StressChaosStatus

StressChaosStatus defines the observed state of StressChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

instances object (keys:string, values:StressInstance)

Instances always specifies stressing instances

StressInstance

StressInstance is an instance generates stresses

Appears In:
Field Description

uid string

UID is the instance identifier

startTime Time

StartTime specifies when the instance starts

StressMemorySpec

Appears In:
Field Description

size string

specifies N bytes consumed per vm worker, default is the total available memory. One can specify the size as % of total available memory or in units of B, KB/KiB, MB/MiB, GB/GiB, TB/TiB..

options string

extend stress-ng options

Stressor

Stressor defines common configurations of a stressor

Field Description

workers integer

Workers specifies N workers to apply the stressor. Maximum 8192 workers can run by stress-ng

Stressors

Stressors defines plenty of stressors supported to stress system components out. You can use one or more of them to make up various kinds of stresses

Appears In:
Field Description

MemoryStressor stresses virtual memory out

CPUStressor stresses CPU out

Task

Field Description

container Container

Container is the main container image to run in the pod

volumes Volume array

Volumes is a list of volumes that can be mounted by containers in a template.

TcParameter

TcParameter represents the parameters for a traffic control chaos

Field Description

delay DelaySpec

Delay represents the detail about delay action

loss LossSpec

Loss represents the detail about loss action

duplicate DuplicateSpec

DuplicateSpec represents the detail about loss action

corrupt CorruptSpec

Corrupt represents the detail about corrupt action

bandwidth BandwidthSpec

Bandwidth represents the detail about bandwidth control action

TcType (string)

TcType the type of traffic control

Appears In:

Template

Appears In:
Field Description

name string

templateType TemplateType

deadline string

task Task

Task describes the behavior of the custom task. Only used when Type is TypeTask.

children string array

Children describes the children steps of serial or parallel node. Only used when Type is TypeSerial or TypeParallel.

conditionalBranches ConditionalBranch array

ConditionalBranches describes the conditional branches of custom tasks. Only used when Type is TypeTask.

EmbedChaos EmbedChaos

EmbedChaos describe the chaos to be injected with chaos nodes. Only used when Type is Type<Something>Chaos.

Schedule describe the Schedule(describing scheduled chaos) to be injected with chaos nodes. Only used when Type is TypeSchedule.

TemplateType (string)

TimeChaos

TimeChaos is the Schema for the timechaos API

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

TimeChaos

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a time chaos experiment

Most recently observed status of the time chaos experiment

TimeChaosSpec

TimeChaosSpec defines the desired state of TimeChaos

Appears In:
Field Description

ContainerSelector ContainerSelector

timeOffset string

TimeOffset defines the delta time of injected program. It’s a possibly signed sequence of decimal numbers, such as "300ms", "-1.5h" or "2h45m". Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".

clockIds string array

ClockIds defines all affected clock id All available options are ["CLOCK_REALTIME","CLOCK_MONOTONIC","CLOCK_PROCESS_CPUTIME_ID","CLOCK_THREAD_CPUTIME_ID", "CLOCK_MONOTONIC_RAW","CLOCK_REALTIME_COARSE","CLOCK_MONOTONIC_COARSE","CLOCK_BOOTTIME","CLOCK_REALTIME_ALARM", "CLOCK_BOOTTIME_ALARM"] Default value is ["CLOCK_REALTIME"]

duration string

Duration represents the duration of the chaos action

TimeChaosStatus

TimeChaosStatus defines the observed state of TimeChaos

Appears In:
Field Description

ChaosStatus ChaosStatus

Timespec

Timespec represents a time

Appears In:
Field Description

sec integer

nsec integer

Workflow

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

Workflow

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a workflow

Most recently observed status of the workflow

WorkflowCondition

Appears In:
Field Description

reason string

startTime Time

WorkflowConditionType (string)

Appears In:

WorkflowNode

Field Description

apiVersion string

chaos-mesh.org/v1alpha1

kind string

WorkflowNode

TypeMeta TypeMeta

metadata ObjectMeta

Refer to Kubernetes API documentation for fields of metadata.

Spec defines the behavior of a node of workflow

Most recently observed status of the workflow node

WorkflowNodeCondition

Appears In:
Field Description

reason string

WorkflowNodeConditionType (string)

Appears In:

WorkflowNodeSpec

Appears In:
Field Description

templateName string

workflowName string

startTime Time

deadline Time

task Task

children string array

conditionalBranches ConditionalBranch

EmbedChaos EmbedChaos

schedule ScheduleSpec

WorkflowNodeStatus

Appears In:
Field Description

ChaosResource refs to the real chaos CR object.

conditionalBranchesStatus ConditionalBranchesStatus

ConditionalBranchesStatus records the evaluation result of each ConditionalBranch

activeChildren LocalObjectReference

ActiveChildren means the created children node

finishedChildren LocalObjectReference

Children is necessary for representing the order when replicated child template references by parent template.

conditions WorkflowNodeCondition array

Represents the latest available observations of a workflow node’s current state.

WorkflowSpec

Appears In:
Field Description

entry string

templates Template array

WorkflowStatus

Appears In:
Field Description

entryNode string

startTime Time

endTime Time

conditions WorkflowCondition array

Represents the latest available observations of a workflow’s current state.