const ( // ValidateSchedulerError defines the error message for ValidateScheduler ValidateSchedulerError = "schedule and duration should be omitted or defined at the same time" // ValidatePodchaosSchedulerError defines the error message for ValidateScheduler of Podchaos ValidatePodchaosSchedulerError = "schedule should be omitted" // ValidateValueParseError defines the error message for value parse error ValidateValueParseError = "parse value field error:%s" )
const ( // DefaultJitter defines default value for jitter DefaultJitter = "0ms" // DefaultCorrelation defines default value for correlation DefaultCorrelation = "0" )
KindIOChaos is the kind for io chaos
const KindIOChaos = "IoChaos"
KindKernelChaos is the kind for kernel chaos
const KindKernelChaos = "KernelChaos"
KindNetworkChaos is the kind for network chaos
const KindNetworkChaos = "NetworkChaos"
KindPodChaos is the kind for pod chaos
const KindPodChaos = "PodChaos"
KindPodNetworkChaos is the kind for network chaos
const KindPodNetworkChaos = "PodNetworkChaos"
KindStressChaos is the kind for stress chaos
const KindStressChaos = "StressChaos"
KindTimeChaos is the kind for time chaos
const KindTimeChaos = "TimeChaos"
const ( // PauseAnnotationKey defines the annotation used to pause a chaos PauseAnnotationKey = "experiment.chaos-mesh.org/pause" )
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "chaos-mesh.org", Version: "v1alpha1"} // SchemeBuilder is used to add go types to the GroupVersionKind scheme SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion} // AddToScheme adds the types in this group-version to the given scheme. AddToScheme = SchemeBuilder.AddToScheme )
func AllKinds() map[string]*ChaosKind
AllKinds returns all chaos kinds.
func ParseCron(standardSpec string, cronField *field.Path) (cronv3.Schedule, field.ErrorList)
ParseCron returns a new crontab schedule representing the given standardSpec (https://en.wikipedia.org/wiki/Cron)
func RegisterPodIoHandler(newHandler PodIoChaosHandler)
RegisterPodIoHandler registers handler into webhook
func RegisterRawPodNetworkHandler(newHandler PodNetworkChaosHandler)
RegisterRawPodNetworkHandler registers handler into webhook
func ValidatePodMode(value string, mode PodMode, valueField *field.Path) field.ErrorList
ValidatePodMode validates the value with podmode
func ValidateScheduler(schedulerObject InnerSchedulerObject, spec *field.Path) field.ErrorList
ValidateScheduler validates the InnerSchedulerObject
AttrOverrideSpec represents an override of attribution
type AttrOverrideSpec struct { //+optional Ino *uint64 `json:"ino,omitempty"` //+optional Size *uint64 `json:"size,omitempty"` //+optional Blocks *uint64 `json:"blocks,omitempty"` //+optional Atime *Timespec `json:"atime,omitempty"` //+optional Mtime *Timespec `json:"mtime,omitempty"` //+optional Ctime *Timespec `json:"ctime,omitempty"` //+optional Kind *FileType `json:"kind,omitempty"` //+optional Perm *uint16 `json:"perm,omitempty"` //+optional Nlink *uint32 `json:"nlink,omitempty"` //+optional UID *uint32 `json:"uid,omitempty"` //+optional GID *uint32 `json:"gid,omitempty"` //+optional Rdev *uint32 `json:"rdev,omitempty"` }
func (in *AttrOverrideSpec) DeepCopy() *AttrOverrideSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AttrOverrideSpec.
func (in *AttrOverrideSpec) DeepCopyInto(out *AttrOverrideSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
BandwidthSpec defines detail of bandwidth limit.
type BandwidthSpec struct { // Rate is the speed knob. Allows bps, kbps, mbps, gbps, tbps unit. bps means bytes per second. Rate string `json:"rate"` // Limit is the number of bytes that can be queued waiting for tokens to become available. // +kubebuilder:validation:Minimum=1 Limit uint32 `json:"limit"` // Buffer is the maximum amount of bytes that tokens can be available for instantaneously. // +kubebuilder:validation:Minimum=1 Buffer uint32 `json:"buffer"` // 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. // +optional // +kubebuilder:validation:Minimum=0 Peakrate *uint64 `json:"peakrate,omitempty"` // 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. // +optional // +kubebuilder:validation:Minimum=0 Minburst *uint32 `json:"minburst,omitempty"` }
func (in *BandwidthSpec) DeepCopy() *BandwidthSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BandwidthSpec.
func (in *BandwidthSpec) DeepCopyInto(out *BandwidthSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *BandwidthSpec) ToTbf() (*chaosdaemonpb.Tbf, error)
ToTbf converts BandwidthSpec to *chaosdaemonpb.Tbf Bandwidth action use TBF under the hood. TBF stands for Token Bucket Filter, is a classful queueing discipline available for traffic control with the tc command. http://man7.org/linux/man-pages/man8/tc-tbf.8.html
CPUStressor defines how to stress CPU out
type CPUStressor struct { Stressor `json:",inline"` // Load specifies P percent loading per CPU worker. 0 is effectively a sleep (no load) and 100 // is full loading. // +optional Load *int `json:"load,omitempty"` // extend stress-ng options // +optional Options []string `json:"options,omitempty"` }
func (in *CPUStressor) DeepCopy() *CPUStressor
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUStressor.
func (in *CPUStressor) DeepCopyInto(out *CPUStressor)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CPUStressor) Validate(parent *field.Path) field.ErrorList
Validate validates whether the CPUStressor is well defined
ChainDirection represents the direction of chain
type ChainDirection string
const ( // Input means this chain is linked with INPUT chain Input ChainDirection = "input" // Output means this chain is linked with OUTPUT chain Output ChainDirection = "output" )
ChaosInstance defines some common attribute for a chaos
type ChaosInstance struct { Name string Namespace string Kind string StartTime time.Time EndTime time.Time Action string Duration string Status string UID string }
ChaosKind includes one kind of chaos and its list type
type ChaosKind struct { Chaos runtime.Object ChaosList }
ChaosList defines a common interface for chaos lists
type ChaosList interface { runtime.Object ListChaos() []*ChaosInstance }
ChaosPhase is the current status of chaos task.
type ChaosPhase string
const ( ChaosPhaseNone ChaosPhase = "" ChaosPhaseNormal ChaosPhase = "Normal" ChaosPhaseAbnormal ChaosPhase = "Abnormal" )
type ChaosStatus struct { // Phase is the chaos status. Phase ChaosPhase `json:"phase"` Reason string `json:"reason,omitempty"` FailedMessage string `json:"failedMessage,omitempty"` Scheduler ScheduleStatus `json:"scheduler,omitempty"` // Experiment records the last experiment state. Experiment ExperimentStatus `json:"experiment"` }
func (in *ChaosStatus) DeepCopy() *ChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ChaosStatus.
func (in *ChaosStatus) DeepCopyInto(out *ChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
ChaosValidator describes the interface should be implemented in chaos
type ChaosValidator interface { webhook.Validator // Validate validates chaos object Validate() error // ValidateScheduler validates the scheduler and duration ValidateScheduler(spec *field.Path) field.ErrorList // ValidatePodMode validates the value with podmode ValidatePodMode(spec *field.Path) field.ErrorList }
CorruptSpec defines detail of a corrupt action
type CorruptSpec struct { Corrupt string `json:"corrupt"` Correlation string `json:"correlation"` }
func (in *CorruptSpec) DeepCopy() *CorruptSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CorruptSpec.
func (in *CorruptSpec) DeepCopyInto(out *CorruptSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *CorruptSpec) ToNetem() (*chaosdaemonpb.Netem, error)
ToNetem implements Netem interface.
DelaySpec defines detail of a delay action
type DelaySpec struct { Latency string `json:"latency"` Correlation string `json:"correlation,omitempty"` Jitter string `json:"jitter,omitempty"` Reorder *ReorderSpec `json:"reorder,omitempty"` }
func (in *DelaySpec) DeepCopy() *DelaySpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DelaySpec.
func (in *DelaySpec) DeepCopyInto(out *DelaySpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DelaySpec) ToNetem() (*chaosdaemonpb.Netem, error)
ToNetem implements Netem interface.
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.
type Direction string
const ( // To represents network packet from source to target To Direction = "to" // From represents network packet to source from target From Direction = "from" // Both represents both directions Both Direction = "both" )
DuplicateSpec defines detail of a duplicate action
type DuplicateSpec struct { Duplicate string `json:"duplicate"` Correlation string `json:"correlation"` }
func (in *DuplicateSpec) DeepCopy() *DuplicateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DuplicateSpec.
func (in *DuplicateSpec) DeepCopyInto(out *DuplicateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DuplicateSpec) ToNetem() (*chaosdaemonpb.Netem, error)
ToNetem implements Netem interface.
ExperimentPhase is the current status of chaos experiment.
type ExperimentPhase string
const ( ExperimentPhaseRunning ExperimentPhase = "Running" ExperimentPhaseWaiting ExperimentPhase = "Waiting" ExperimentPhasePaused ExperimentPhase = "Paused" ExperimentPhaseFailed ExperimentPhase = "Failed" ExperimentPhaseFinished ExperimentPhase = "Finished" )
type ExperimentStatus struct { // +optional Phase ExperimentPhase `json:"phase,omitempty"` // +optional Reason string `json:"reason,omitempty"` // +optional StartTime *metav1.Time `json:"startTime,omitempty"` // +optional EndTime *metav1.Time `json:"endTime,omitempty"` // +optional Duration string `json:"duration,omitempty"` // +optional PodRecords []PodStatus `json:"podRecords,omitempty"` }
func (in *ExperimentStatus) DeepCopy() *ExperimentStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ExperimentStatus.
func (in *ExperimentStatus) DeepCopyInto(out *ExperimentStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
FailKernRequest defines the injection conditions
type FailKernRequest struct { // 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 // +kubebuilder:validation:Maximum=2 // +kubebuilder:validation:Minimum=0 FailType int32 `json:"failtype"` // Headers indicates the appropriate kernel headers you need. // Eg: "linux/mmzone.h", "linux/blkdev.h" and so on Headers []string `json:"headers,omitempty"` // 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). Callchain []Frame `json:"callchain,omitempty"` // Probability indicates the fails with probability. // If you want 1%, please set this field with 1. // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 Probability uint32 `json:"probability,omitempty"` // Times indicates the max times of fails. // +kubebuilder:validation:Minimum=0 Times uint32 `json:"times,omitempty"` }
func (in *FailKernRequest) DeepCopy() *FailKernRequest
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FailKernRequest.
func (in *FailKernRequest) DeepCopyInto(out *FailKernRequest)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
FileType represents type of a file
type FileType string
const ( NamedPipe FileType = "namedPipe" CharDevice FileType = "charDevice" BlockDevice FileType = "blockDevice" Directory FileType = "directory" RegularFile FileType = "regularFile" TSymlink FileType = "symlink" Socket FileType = "socket" )
Filter represents a filter of IoChaos action, which will define the scope of an IoChaosAction
type Filter struct { // Path represents a glob of injecting path Path string `json:"path"` // Methods represents the method that the action will inject in // +optional Methods []IoMethod `json:"methods,omitempty"` // Percent represents the percent probability of injecting this action Percent int `json:"percent"` }
func (in *Filter) DeepCopy() *Filter
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Filter.
func (in *Filter) DeepCopyInto(out *Filter)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Frame defines the function signature and predicate in function's body
type Frame struct { // Funcname can be find from kernel source or `/proc/kallsyms`, such as `ext4_mount` Funcname string `json:"funcname,omitempty"` // 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. Parameters string `json:"parameters,omitempty"` // 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. Predicate string `json:"predicate,omitempty"` }
func (in *Frame) DeepCopy() *Frame
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Frame.
func (in *Frame) DeepCopyInto(out *Frame)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
IOLayer represents the layer of I/O system.
type IOLayer string
InnerObject is basic Object for the Reconciler
type InnerObject interface { IsDeleted() bool IsPaused() bool GetChaos() *ChaosInstance StatefulObject }
InnerSchedulerObject is the Object for the twophase reconcile
type InnerSchedulerObject interface { InnerObject GetDuration() (*time.Duration, error) GetNextStart() time.Time SetNextStart(time.Time) GetNextRecover() time.Time SetNextRecover(time.Time) GetScheduler() *SchedulerSpec }
IoChaos is the Schema for the iochaos API
type IoChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec IoChaosSpec `json:"spec,omitempty"` Status IoChaosStatus `json:"status,omitempty"` }
func (in *IoChaos) DeepCopy() *IoChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IoChaos.
func (in *IoChaos) DeepCopyInto(out *IoChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IoChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *IoChaos) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *IoChaos) GetChaos() *ChaosInstance
GetChaos returns a chaos instance
func (in *IoChaos) GetDuration() (*time.Duration, error)
GetDuration would return the duration for chaos
func (in *IoChaos) GetNextRecover() time.Time
func (in *IoChaos) GetNextStart() time.Time
func (in *IoChaos) GetScheduler() *SchedulerSpec
GetScheduler would return the scheduler for chaos
func (in *IoChaos) GetStatus() *ChaosStatus
func (in *IoChaos) IsDeleted() bool
IsDeleted returns whether this resource has been deleted
func (in *IoChaos) IsPaused() bool
IsPaused returns whether this resource has been paused
func (in *IoChaos) SetNextRecover(t time.Time)
func (in *IoChaos) SetNextStart(t time.Time)
func (in *IoChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setup IoChaos's webhook with manager
func (in *IoChaos) Validate() error
Validate validates chaos object
func (in *IoChaos) ValidateCreate() error
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *IoChaos) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *IoChaos) ValidatePodMode(spec *field.Path) field.ErrorList
ValidatePodMode validates the value with podmode
func (in *IoChaos) ValidateScheduler(spec *field.Path) field.ErrorList
ValidateScheduler validates the scheduler and duration
func (in *IoChaos) ValidateUpdate(old runtime.Object) error
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
IoChaosAction defines an possible action of IoChaos
type IoChaosAction struct { Type IoChaosType `json:"type"` Filter `json:",inline"` // Faults represents the fault to inject // +optional Faults []IoFault `json:"faults,omitempty"` // Latency represents the latency to inject // +optional Latency string `json:"latency,omitempty"` // AttrOverride represents the attribution to override // +optional *AttrOverrideSpec `json:",inline"` // Source represents the source of current rules Source string `json:"source,omitempty"` }
func (in *IoChaosAction) DeepCopy() *IoChaosAction
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IoChaosAction.
func (in *IoChaosAction) DeepCopyInto(out *IoChaosAction)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
IoChaosList contains a list of IoChaos
type IoChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []IoChaos `json:"items"` }
func (in *IoChaosList) DeepCopy() *IoChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IoChaosList.
func (in *IoChaosList) DeepCopyInto(out *IoChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IoChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *IoChaosList) ListChaos() []*ChaosInstance
ListChaos returns a list of io chaos
IoChaosSpec defines the desired state of IoChaos
type IoChaosSpec struct { // Selector is used to select pods that are used to inject chaos action. Selector SelectorSpec `json:"selector"` // Mode defines the mode to run chaos action. // Supported mode: one / all / fixed / fixed-percent / random-max-percent // +kubebuilder:validation:Enum=one;all;fixed;fixed-percent;random-max-percent Mode PodMode `json:"mode"` // Value is required when the mode is set to `FixedPodMode` / `FixedPercentPodMod` / `RandomMaxPercentPodMod`. // If `FixedPodMode`, provide an integer of pods to do chaos action. // If `FixedPercentPodMod`, provide a number from 0-100 to specify the percent of pods the server can do chaos action. // IF `RandomMaxPercentPodMod`, provide a number from 0-100 to specify the max percent of pods to do chaos action // +optional Value string `json:"value"` // Action defines the specific pod chaos action. // Supported action: latency / fault / attrOverride // +kubebuilder:validation:Enum=latency;fault;attrOverride Action IoChaosType `json:"action"` // 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". // +optional Delay string `json:"delay,omitempty"` // 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 // +optional Errno uint32 `json:"errno,omitempty"` // Attr defines the overrided attribution // +optional Attr *AttrOverrideSpec `json:"attr,omitempty"` // Path defines the path of files for injecting I/O chaos action. // +optional Path string `json:"path,omitempty"` // Methods defines the I/O methods for injecting I/O chaos action. // default: all I/O methods. // +optional Methods []IoMethod `json:"methods,omitempty"` // Percent defines the percentage of injection errors and provides a number from 0-100. // default: 100. // +optional Percent int `json:"percent,omitempty"` // VolumePath represents the mount path of injected volume VolumePath string `json:"volumePath"` // Scheduler defines some schedule rules to // control the running time of the chaos experiment about pods. Scheduler *SchedulerSpec `json:"scheduler,omitempty"` // 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". // +optional Duration *string `json:"duration,omitempty"` }
func (in *IoChaosSpec) DeepCopy() *IoChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IoChaosSpec.
func (in *IoChaosSpec) DeepCopyInto(out *IoChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *IoChaosSpec) GetMode() PodMode
func (in *IoChaosSpec) GetSelector() SelectorSpec
func (in *IoChaosSpec) GetValue() string
IoChaosStatus defines the observed state of IoChaos
type IoChaosStatus struct { ChaosStatus `json:",inline"` }
func (in *IoChaosStatus) DeepCopy() *IoChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IoChaosStatus.
func (in *IoChaosStatus) DeepCopyInto(out *IoChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
IoChaosType represents the type of an IoChaos Action
type IoChaosType string
const ( // IoLatency represents injecting latency for io operation IoLatency IoChaosType = "latency" // IoFaults represents injecting faults for io operation IoFaults IoChaosType = "fault" // IoAttrOverride represents replacing attribution for io operation IoAttrOverride IoChaosType = "attrOverride" )
IoFault represents the fault to inject and their weight
type IoFault struct { Errno uint32 `json:"errno"` Weight int32 `json:"weight"` }
func (in *IoFault) DeepCopy() *IoFault
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new IoFault.
func (in *IoFault) DeepCopyInto(out *IoFault)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type IoMethod string
const ( LookUp IoMethod = "lookup" Forget IoMethod = "forget" GetAttr IoMethod = "getattr" SetAttr IoMethod = "setattr" ReadLink IoMethod = "readlink" Mknod IoMethod = "mknod" Mkdir IoMethod = "mkdir" UnLink IoMethod = "unlink" Rmdir IoMethod = "rmdir" MSymlink IoMethod = "symlink" Rename IoMethod = "rename" Link IoMethod = "link" Open IoMethod = "open" Read IoMethod = "read" Write IoMethod = "write" Flush IoMethod = "flush" Release IoMethod = "release" Fsync IoMethod = "fsync" Opendir IoMethod = "opendir" Readdir IoMethod = "readdir" Releasedir IoMethod = "releasedir" Fsyncdir IoMethod = "fsyncdir" Statfs IoMethod = "statfs" SetXAttr IoMethod = "setxattr" GetXAttr IoMethod = "getxattr" ListXAttr IoMethod = "listxattr" RemoveXAttr IoMethod = "removexattr" Access IoMethod = "access" Create IoMethod = "create" GetLk IoMethod = "getlk" SetLk IoMethod = "setlk" Bmap IoMethod = "bmap" )
KernelChaos is the Schema for the kernelchaos API
type KernelChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines the behavior of a kernel chaos experiment Spec KernelChaosSpec `json:"spec"` // +optional // Most recently observed status of the kernel chaos experiment Status KernelChaosStatus `json:"status"` }
func (in *KernelChaos) DeepCopy() *KernelChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelChaos.
func (in *KernelChaos) DeepCopyInto(out *KernelChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KernelChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KernelChaos) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *KernelChaos) GetChaos() *ChaosInstance
GetChaos returns a chaos instance
func (in *KernelChaos) GetDuration() (*time.Duration, error)
GetDuration gets the duration of KernelChaos
func (in *KernelChaos) GetNextRecover() time.Time
GetNextRecover gets NextRecover field of KernelChaos
func (in *KernelChaos) GetNextStart() time.Time
GetNextStart gets NextStart field of KernelChaos
func (in *KernelChaos) GetScheduler() *SchedulerSpec
GetScheduler returns the scheduler of KernelChaos
func (in *KernelChaos) GetStatus() *ChaosStatus
GetStatus returns the status of KernelChaos
func (in *KernelChaos) IsDeleted() bool
IsDeleted returns whether this resource has been deleted
func (in *KernelChaos) IsPaused() bool
IsPaused returns whether this resource has been paused
func (in *KernelChaos) SetNextRecover(t time.Time)
SetNextRecover sets NextRecover field of KernelChaos
func (in *KernelChaos) SetNextStart(t time.Time)
SetNextStart sets NextStart field of KernelChaos
func (in *KernelChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setup KernelChaos's webhook with manager
func (in *KernelChaos) Validate() error
Validate validates chaos object
func (in *KernelChaos) ValidateCreate() error
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *KernelChaos) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *KernelChaos) ValidatePodMode(spec *field.Path) field.ErrorList
ValidatePodMode validates the value with podmode
func (in *KernelChaos) ValidateScheduler(spec *field.Path) field.ErrorList
ValidateScheduler validates the scheduler and duration
func (in *KernelChaos) ValidateUpdate(old runtime.Object) error
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
KernelChaosList contains a list of KernelChaos
type KernelChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []KernelChaos `json:"items"` }
func (in *KernelChaosList) DeepCopy() *KernelChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelChaosList.
func (in *KernelChaosList) DeepCopyInto(out *KernelChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KernelChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *KernelChaosList) ListChaos() []*ChaosInstance
ListChaos returns a list of kernel chaos
KernelChaosSpec defines the desired state of KernelChaos
type KernelChaosSpec struct { // Mode defines the mode to run chaos action. // Supported mode: one / all / fixed / fixed-percent / random-max-percent // +kubebuilder:validation:Enum=one;all;fixed;fixed-percent;random-max-percent Mode PodMode `json:"mode"` // Value is required when the mode is set to `FixedPodMode` / `FixedPercentPodMod` / `RandomMaxPercentPodMod`. // If `FixedPodMode`, provide an integer of pods to do chaos action. // If `FixedPercentPodMod`, provide a number from 0-100 to specify the percent of pods the server can do chaos action. // If `RandomMaxPercentPodMod`, provide a number from 0-100 to specify the max percent of pods to do chaos action // +optional Value string `json:"value"` // Selector is used to select pods that are used to inject chaos action. Selector SelectorSpec `json:"selector"` // FailKernRequest defines the request of kernel injection FailKernRequest FailKernRequest `json:"failKernRequest"` // Duration represents the duration of the chaos action Duration *string `json:"duration,omitempty"` // Scheduler defines some schedule rules to control the running time of the chaos experiment about time. Scheduler *SchedulerSpec `json:"scheduler,omitempty"` }
func (in *KernelChaosSpec) DeepCopy() *KernelChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelChaosSpec.
func (in *KernelChaosSpec) DeepCopyInto(out *KernelChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KernelChaosSpec) GetMode() PodMode
GetMode is a getter for Mode (for implementing SelectSpec)
func (in *KernelChaosSpec) GetSelector() SelectorSpec
GetSelector is a getter for Selector (for implementing SelectSpec)
func (in *KernelChaosSpec) GetValue() string
GetValue is a getter for Value (for implementing SelectSpec)
KernelChaosStatus defines the observed state of KernelChaos
type KernelChaosStatus struct { ChaosStatus `json:",inline"` }
func (in *KernelChaosStatus) DeepCopy() *KernelChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KernelChaosStatus.
func (in *KernelChaosStatus) DeepCopyInto(out *KernelChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
LossSpec defines detail of a loss action
type LossSpec struct { Loss string `json:"loss"` Correlation string `json:"correlation"` }
func (in *LossSpec) DeepCopy() *LossSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LossSpec.
func (in *LossSpec) DeepCopyInto(out *LossSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *LossSpec) ToNetem() (*chaosdaemonpb.Netem, error)
ToNetem implements Netem interface.
MemoryStressor defines how to stress memory out
type MemoryStressor struct { Stressor `json:",inline"` // extend stress-ng options // +optional Options []string `json:"options,omitempty"` }
func (in *MemoryStressor) DeepCopy() *MemoryStressor
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MemoryStressor.
func (in *MemoryStressor) DeepCopyInto(out *MemoryStressor)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *MemoryStressor) Validate(parent *field.Path) field.ErrorList
Validate validates whether the MemoryStressor is well defined
NetworkChaos is the Schema for the networkchaos API
type NetworkChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines the behavior of a pod chaos experiment Spec NetworkChaosSpec `json:"spec"` // +optional // Most recently observed status of the chaos experiment about pods Status NetworkChaosStatus `json:"status"` }
func (in *NetworkChaos) DeepCopy() *NetworkChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChaos.
func (in *NetworkChaos) DeepCopyInto(out *NetworkChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NetworkChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *NetworkChaos) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *NetworkChaos) GetChaos() *ChaosInstance
GetChaos returns a chaos instance
func (in *NetworkChaos) GetDuration() (*time.Duration, error)
GetDuration would return the duration for chaos
func (in *NetworkChaos) GetNextRecover() time.Time
func (in *NetworkChaos) GetNextStart() time.Time
func (in *NetworkChaos) GetScheduler() *SchedulerSpec
GetScheduler would return the scheduler for chaos
func (in *NetworkChaos) GetStatus() *ChaosStatus
func (in *NetworkChaos) IsDeleted() bool
IsDeleted returns whether this resource has been deleted
func (in *NetworkChaos) IsPaused() bool
IsPaused returns whether this resource has been paused
func (in *NetworkChaos) SetNextRecover(t time.Time)
func (in *NetworkChaos) SetNextStart(t time.Time)
func (in *NetworkChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setup NetworkChaos's webhook with manager
func (in *NetworkChaos) Validate() error
Validate validates chaos object
func (in *NetworkChaos) ValidateCreate() error
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *NetworkChaos) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *NetworkChaos) ValidateExternalTargets(target *field.Path) field.ErrorList
ValidateExternalTargets validates externalTargets must be with `to` direction
func (in *NetworkChaos) ValidatePodMode(spec *field.Path) field.ErrorList
ValidatePodMode validates the value with podmode
func (in *NetworkChaos) ValidateScheduler(spec *field.Path) field.ErrorList
ValidateScheduler validates the scheduler and duration
func (in *NetworkChaos) ValidateUpdate(old runtime.Object) error
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
ChaosAction represents the chaos action about pods.
type NetworkChaosAction string
const ( // NetemAction is a combination of several chaos actions i.e. delay, loss, duplicate, corrupt. // When using this action multiple specs are merged into one Netem RPC and sends to chaos daemon. NetemAction NetworkChaosAction = "netem" // DelayAction represents the chaos action of adding delay on pods. DelayAction NetworkChaosAction = "delay" // LossAction represents the chaos action of losing packets on pods. LossAction NetworkChaosAction = "loss" // DuplicateAction represents the chaos action of duplicating packets on pods. DuplicateAction NetworkChaosAction = "duplicate" // CorruptAction represents the chaos action of corrupting packets on pods. CorruptAction NetworkChaosAction = "corrupt" // PartitionAction represents the chaos action of network partition of pods. PartitionAction NetworkChaosAction = "partition" // BandwidthAction represents the chaos action of network bandwidth of pods. BandwidthAction NetworkChaosAction = "bandwidth" )
NetworkChaosList contains a list of NetworkChaos
type NetworkChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []NetworkChaos `json:"items"` }
func (in *NetworkChaosList) DeepCopy() *NetworkChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChaosList.
func (in *NetworkChaosList) DeepCopyInto(out *NetworkChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NetworkChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *NetworkChaosList) ListChaos() []*ChaosInstance
ListChaos returns a list of network chaos
NetworkChaosSpec defines the desired state of NetworkChaos
type NetworkChaosSpec struct { // Action defines the specific network chaos action. // Supported action: partition, netem, delay, loss, duplicate, corrupt // Default action: delay // +kubebuilder:validation:Enum=netem;delay;loss;duplicate;corrupt;partition;bandwidth Action NetworkChaosAction `json:"action"` // Mode defines the mode to run chaos action. // Supported mode: one / all / fixed / fixed-percent / random-max-percent // +kubebuilder:validation:Enum=one;all;fixed;fixed-percent;random-max-percent Mode PodMode `json:"mode"` // Value is required when the mode is set to `FixedPodMode` / `FixedPercentPodMod` / `RandomMaxPercentPodMod`. // If `FixedPodMode`, provide an integer of pods to do chaos action. // If `FixedPercentPodMod`, provide a number from 0-100 to specify the percent of pods the server can do chaos action. // If `RandomMaxPercentPodMod`, provide a number from 0-100 to specify the max percent of pods to do chaos action // +optional Value string `json:"value"` // Selector is used to select pods that are used to inject chaos action. Selector SelectorSpec `json:"selector"` // Duration represents the duration of the chaos action Duration *string `json:"duration,omitempty"` // Scheduler defines some schedule rules to control the running time of the chaos experiment about network. Scheduler *SchedulerSpec `json:"scheduler,omitempty"` // TcParameter represents the traffic control definition TcParameter `json:",inline"` // Direction represents the direction, this applies on netem and network partition action // +optional // +kubebuilder:validation:Enum=to;from;both;"" Direction Direction `json:"direction,omitempty"` // Target represents network target, this applies on netem and network partition action // +optional Target *Target `json:"target,omitempty"` // ExternalTargets represents network targets outside k8s // +optional ExternalTargets []string `json:"externalTargets,omitempty"` }
func (in *NetworkChaosSpec) DeepCopy() *NetworkChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChaosSpec.
func (in *NetworkChaosSpec) DeepCopyInto(out *NetworkChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *NetworkChaosSpec) DefaultDelay()
DefaultDelay set the default value if Jitter or Correlation is not set
func (in *NetworkChaosSpec) GetMode() PodMode
GetMode is a getter for Mode (for implementing SelectSpec)
func (in *NetworkChaosSpec) GetSelector() SelectorSpec
GetSelector is a getter for Selector (for implementing SelectSpec)
func (in *NetworkChaosSpec) GetValue() string
GetValue is a getter for Value (for implementing SelectSpec)
NetworkChaosStatus defines the observed state of NetworkChaos
type NetworkChaosStatus struct { ChaosStatus `json:",inline"` }
func (in *NetworkChaosStatus) DeepCopy() *NetworkChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkChaosStatus.
func (in *NetworkChaosStatus) DeepCopyInto(out *NetworkChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
PodChaos is the control script`s spec.
type PodChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines the behavior of a pod chaos experiment Spec PodChaosSpec `json:"spec"` // +optional // Most recently observed status of the chaos experiment about pods Status PodChaosStatus `json:"status"` }
func (in *PodChaos) DeepCopy() *PodChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodChaos.
func (in *PodChaos) DeepCopyInto(out *PodChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PodChaos) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *PodChaos) GetChaos() *ChaosInstance
GetChaos returns a chaos instance
func (in *PodChaos) GetDuration() (*time.Duration, error)
GetDuration would return the duration for chaos
func (in *PodChaos) GetNextRecover() time.Time
func (in *PodChaos) GetNextStart() time.Time
func (in *PodChaos) GetScheduler() *SchedulerSpec
GetScheduler would return the scheduler for chaos
func (in *PodChaos) GetStatus() *ChaosStatus
func (in *PodChaos) IsDeleted() bool
IsDeleted returns whether this resource has been deleted
func (in *PodChaos) IsPaused() bool
IsPaused returns whether this resource has been paused
func (in *PodChaos) SetNextRecover(t time.Time)
func (in *PodChaos) SetNextStart(t time.Time)
func (in *PodChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setup PodChaos's webhook with manager
func (in *PodChaos) Validate() error
Validate validates chaos object
func (in *PodChaos) ValidateCreate() error
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *PodChaos) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *PodChaos) ValidatePodMode(spec *field.Path) field.ErrorList
ValidatePodMode validates the value with podmode
func (in *PodChaos) ValidateScheduler(spec *field.Path) field.ErrorList
ValidateScheduler validates the scheduler and duration
func (in *PodChaos) ValidateUpdate(old runtime.Object) error
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
PodChaosAction represents the chaos action about pods.
type PodChaosAction string
const ( // PodKillAction represents the chaos action of killing pods. PodKillAction PodChaosAction = "pod-kill" // PodFailureAction represents the chaos action of injecting errors to pods. // This action will cause the pod to not be created for a while. PodFailureAction PodChaosAction = "pod-failure" // ContainerKillAction represents the chaos action of killing the container ContainerKillAction PodChaosAction = "container-kill" )
PodChaosList is PodChaos list.
type PodChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata"` Items []PodChaos `json:"items"` }
func (in *PodChaosList) DeepCopy() *PodChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodChaosList.
func (in *PodChaosList) DeepCopyInto(out *PodChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PodChaosList) ListChaos() []*ChaosInstance
ListChaos returns a list of pod chaos
PodChaosSpec defines the attributes that a user creates on a chaos experiment about pods.
type PodChaosSpec struct { // Selector is used to select pods that are used to inject chaos action. Selector SelectorSpec `json:"selector"` // Scheduler defines some schedule rules to // control the running time of the chaos experiment about pods. Scheduler *SchedulerSpec `json:"scheduler,omitempty"` // Action defines the specific pod chaos action. // Supported action: pod-kill / pod-failure / container-kill // Default action: pod-kill // +kubebuilder:validation:Enum=pod-kill;pod-failure;container-kill Action PodChaosAction `json:"action"` // Mode defines the mode to run chaos action. // Supported mode: one / all / fixed / fixed-percent / random-max-percent // +kubebuilder:validation:Enum=one;all;fixed;fixed-percent;random-max-percent Mode PodMode `json:"mode"` // Value is required when the mode is set to `FixedPodMode` / `FixedPercentPodMod` / `RandomMaxPercentPodMod`. // If `FixedPodMode`, provide an integer of pods to do chaos action. // If `FixedPercentPodMod`, provide a number from 0-100 to specify the percent of pods the server can do chaos action. // IF `RandomMaxPercentPodMod`, provide a number from 0-100 to specify the max percent of pods to do chaos action // +optional Value string `json:"value"` // 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". // +optional Duration *string `json:"duration,omitempty"` // ContainerName indicates the name of the container. // Needed in container-kill. // +optional ContainerName string `json:"containerName"` // 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. // +optional // +kubebuilder:validation:Minimum=0 GracePeriod int64 `json:"gracePeriod"` }
func (in *PodChaosSpec) DeepCopy() *PodChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodChaosSpec.
func (in *PodChaosSpec) DeepCopyInto(out *PodChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodChaosSpec) GetMode() PodMode
func (in *PodChaosSpec) GetSelector() SelectorSpec
func (in *PodChaosSpec) GetValue() string
PodChaosStatus represents the current status of the chaos experiment about pods.
type PodChaosStatus struct { ChaosStatus `json:",inline"` }
func (in *PodChaosStatus) DeepCopy() *PodChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodChaosStatus.
func (in *PodChaosStatus) DeepCopyInto(out *PodChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
PodIoChaos is the Schema for the podiochaos API
type PodIoChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec PodIoChaosSpec `json:"spec,omitempty"` }
func (in *PodIoChaos) DeepCopy() *PodIoChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodIoChaos.
func (in *PodIoChaos) DeepCopyInto(out *PodIoChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodIoChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PodIoChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setup PodIoChaos's webhook with manager
PodIoChaosHandler represents the implementation of podiochaos
type PodIoChaosHandler interface { Apply(context.Context, *PodIoChaos) error }
PodIoChaosList contains a list of PodIoChaos
type PodIoChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []PodIoChaos `json:"items"` }
func (in *PodIoChaosList) DeepCopy() *PodIoChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodIoChaosList.
func (in *PodIoChaosList) DeepCopyInto(out *PodIoChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodIoChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
PodIoChaosSpec defines the desired state of IoChaos
type PodIoChaosSpec struct { // 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 VolumeMountPath string `json:"volumeMountPath"` // Pid represents a running toda process id // +optional Pid int64 `json:"pid,omitempty"` // StartTime represents the start time of a toda process // +optional StartTime int64 `json:"startTime,omitempty"` // Actions are a list of IoChaos actions // +optional Actions []IoChaosAction `json:"actions,omitempty"` }
func (in *PodIoChaosSpec) DeepCopy() *PodIoChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodIoChaosSpec.
func (in *PodIoChaosSpec) DeepCopyInto(out *PodIoChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
PodIoChaosWebhookRunner runs webhook for podiochaos
type PodIoChaosWebhookRunner struct {
// contains filtered or unexported fields
}
func (r *PodIoChaosWebhookRunner) Handle(ctx context.Context, req admission.Request) admission.Response
Handle will run poiochaoshandler for this resource
func (r *PodIoChaosWebhookRunner) InjectDecoder(d *admission.Decoder) error
InjectDecoder injects decoder into webhook runner
PodMode represents the mode to run pod chaos action.
type PodMode string
const ( // OnePodMode represents that the system will do the chaos action on one pod selected randomly. OnePodMode PodMode = "one" // AllPodMode represents that the system will do the chaos action on all pods // regardless of status (not ready or not running pods includes). // Use this label carefully. AllPodMode PodMode = "all" // FixedPodMode represents that the system will do the chaos action on a specific number of running pods. FixedPodMode PodMode = "fixed" // FixedPercentPodMode to specify a fixed % that can be inject chaos action. FixedPercentPodMode PodMode = "fixed-percent" // RandomMaxPercentPodMode to specify a maximum % that can be inject chaos action. RandomMaxPercentPodMode PodMode = "random-max-percent" )
PodNetworkChaos is the Schema for the PodNetworkChaos API
type PodNetworkChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines the behavior of a pod chaos experiment Spec PodNetworkChaosSpec `json:"spec"` // +optional // Most recently observed status of the chaos experiment about pods Status PodNetworkChaosStatus `json:"status"` }
func (in *PodNetworkChaos) DeepCopy() *PodNetworkChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodNetworkChaos.
func (in *PodNetworkChaos) DeepCopyInto(out *PodNetworkChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodNetworkChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PodNetworkChaos) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *PodNetworkChaos) GetChaos() *ChaosInstance
GetChaos returns a chaos instance
func (in *PodNetworkChaos) GetStatus() *ChaosStatus
GetStatus returns the status of chaos
func (in *PodNetworkChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setup PodNetworkChaos's webhook with manager
func (in *PodNetworkChaos) ValidateCreate() error
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *PodNetworkChaos) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *PodNetworkChaos) ValidateUpdate(old runtime.Object) error
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
PodNetworkChaosHandler represents the implementation of podnetworkchaos
type PodNetworkChaosHandler interface { Apply(context.Context, *PodNetworkChaos) error }
PodNetworkChaosList contains a list of PodNetworkChaos
type PodNetworkChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []PodNetworkChaos `json:"items"` }
func (in *PodNetworkChaosList) DeepCopy() *PodNetworkChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodNetworkChaosList.
func (in *PodNetworkChaosList) DeepCopyInto(out *PodNetworkChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *PodNetworkChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *PodNetworkChaosList) ListChaos() []*ChaosInstance
ListChaos returns a list of network chaos
PodNetworkChaosSpec defines the desired state of PodNetworkChaos
type PodNetworkChaosSpec struct { // The ipset on the pod // +optional IPSets []RawIPSet `json:"ipsets,omitempty"` // The iptables rules on the pod // +optional Iptables []RawIptables `json:"iptables,omitempty"` // The tc rules on the pod // +optional TrafficControls []RawTrafficControl `json:"tcs,omitempty"` }
func (in *PodNetworkChaosSpec) DeepCopy() *PodNetworkChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodNetworkChaosSpec.
func (in *PodNetworkChaosSpec) DeepCopyInto(out *PodNetworkChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
PodNetworkChaosStatus defines the observed state of PodNetworkChaos
type PodNetworkChaosStatus struct { ChaosStatus `json:",inline"` }
func (in *PodNetworkChaosStatus) DeepCopy() *PodNetworkChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodNetworkChaosStatus.
func (in *PodNetworkChaosStatus) DeepCopyInto(out *PodNetworkChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
PodStatus represents information about the status of a pod in chaos experiment.
type PodStatus struct { Namespace string `json:"namespace"` Name string `json:"name"` Action string `json:"action"` HostIP string `json:"hostIP"` PodIP string `json:"podIP"` // A brief CamelCase message indicating details about the chaos action. // e.g. "delete this pod" or "pause this pod duration 5m" // +optional Message string `json:"message"` }
func (in *PodStatus) DeepCopy() *PodStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PodStatus.
func (in *PodStatus) DeepCopyInto(out *PodStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
RawIPSet represents an ipset on specific pod
type RawIPSet struct { // The name of ipset Name string `json:"name"` // The contents of ipset Cidrs []string `json:"cidrs"` // The name and namespace of the source network chaos RawRuleSource `json:",inline"` }
func (in *RawIPSet) DeepCopy() *RawIPSet
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawIPSet.
func (in *RawIPSet) DeepCopyInto(out *RawIPSet)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
RawIptables represents the iptables rules on specific pod
type RawIptables struct { // The name of iptables chain Name string `json:"name"` // The name of related ipset IPSets []string `json:"ipsets"` // The block direction of this iptables rule Direction ChainDirection `json:"direction"` RawRuleSource `json:",inline"` }
func (in *RawIptables) DeepCopy() *RawIptables
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawIptables.
func (in *RawIptables) DeepCopyInto(out *RawIptables)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
RawRuleSource represents the name and namespace of the source network chaos
type RawRuleSource struct { Source string `json:"source"` }
func (in *RawRuleSource) DeepCopy() *RawRuleSource
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawRuleSource.
func (in *RawRuleSource) DeepCopyInto(out *RawRuleSource)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
RawTrafficControl represents the traffic control chaos on specific pod
type RawTrafficControl struct { // The type of traffic control Type TcType `json:"type"` TcParameter `json:",inline"` // The name of target ipset // +optional IPSet string `json:"ipset,omitempty"` // The name and namespace of the source network chaos Source string `json:"source"` }
func (in *RawTrafficControl) DeepCopy() *RawTrafficControl
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RawTrafficControl.
func (in *RawTrafficControl) DeepCopyInto(out *RawTrafficControl)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
ReorderSpec defines details of packet reorder.
type ReorderSpec struct { Reorder string `json:"reorder"` Correlation string `json:"correlation"` Gap int `json:"gap"` }
func (in *ReorderSpec) DeepCopy() *ReorderSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReorderSpec.
func (in *ReorderSpec) DeepCopyInto(out *ReorderSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
ScheduleStatus is the current status of chaos scheduler.
type ScheduleStatus struct { // Next time when this action will be applied again // +optional NextStart *metav1.Time `json:"nextStart,omitempty"` // Next time when this action will be recovered // +optional NextRecover *metav1.Time `json:"nextRecover,omitempty"` }
func (in *ScheduleStatus) DeepCopy() *ScheduleStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScheduleStatus.
func (in *ScheduleStatus) DeepCopyInto(out *ScheduleStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
SchedulerSpec defines information about schedule of the chaos experiment.
type SchedulerSpec struct { // Cron defines a cron job rule. // // Some rule examples: // "0 30 * * * *" means to "Every hour on the half hour" // "@hourly" means to "Every hour" // "@every 1h30m" means to "Every hour thirty" // // More rule info: https://godoc.org/github.com/robfig/cron Cron string `json:"cron"` }
func (in *SchedulerSpec) DeepCopy() *SchedulerSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SchedulerSpec.
func (in *SchedulerSpec) DeepCopyInto(out *SchedulerSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
SelectorSpec defines the some selectors to select objects. If the all selectors are empty, all objects will be used in chaos experiment.
type SelectorSpec struct { // Namespaces is a set of namespace to which objects belong. // +optional Namespaces []string `json:"namespaces,omitempty"` // Nodes is a set of node name and objects must belong to these nodes. // +optional Nodes []string `json:"nodes,omitempty"` // 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. // +optional Pods map[string][]string `json:"pods,omitempty"` // 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. // +optional NodeSelectors map[string]string `json:"nodeSelectors,omitempty"` // Map of string keys and values that can be used to select objects. // A selector based on fields. // +optional FieldSelectors map[string]string `json:"fieldSelectors,omitempty"` // Map of string keys and values that can be used to select objects. // A selector based on labels. // +optional LabelSelectors map[string]string `json:"labelSelectors,omitempty"` // Map of string keys and values that can be used to select objects. // A selector based on annotations. // +optional AnnotationSelectors map[string]string `json:"annotationSelectors,omitempty"` // PodPhaseSelectors is a set of condition of a pod at the current time. // supported value: Pending / Running / Succeeded / Failed / Unknown // +optional PodPhaseSelectors []string `json:"podPhaseSelectors,omitempty"` }
func (in *SelectorSpec) DeepCopy() *SelectorSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SelectorSpec.
func (in *SelectorSpec) DeepCopyInto(out *SelectorSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *SelectorSpec) DefaultNamespace(namespace string)
DefaultNamespace set the namespace of chaos object as the default namespace selector if namespaces not set
StatefulObject defines a basic Object that can get the status
type StatefulObject interface { runtime.Object GetStatus() *ChaosStatus }
StressChaos is the Schema for the stresschaos API
type StressChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines the behavior of a time chaos experiment Spec StressChaosSpec `json:"spec"` // +optional // Most recently observed status of the time chaos experiment Status StressChaosStatus `json:"status"` }
func (in *StressChaos) DeepCopy() *StressChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StressChaos.
func (in *StressChaos) DeepCopyInto(out *StressChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StressChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *StressChaos) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *StressChaos) GetChaos() *ChaosInstance
GetChaos returns a chaos instance
func (in *StressChaos) GetDuration() (*time.Duration, error)
GetDuration gets the duration of StressChaos
func (in *StressChaos) GetNextRecover() time.Time
GetNextRecover get NextRecover field of StressChaos
func (in *StressChaos) GetNextStart() time.Time
GetNextStart gets NextStart field of StressChaos
func (in *StressChaos) GetScheduler() *SchedulerSpec
GetScheduler returns the scheduler of StressChaos
func (in *StressChaos) GetStatus() *ChaosStatus
GetStatus returns the status of StressChaos
func (in *StressChaos) IsDeleted() bool
IsDeleted returns whether this resource has been deleted
func (in *StressChaos) IsPaused() bool
IsPaused returns whether this resource has been paused
func (in *StressChaos) SetNextRecover(t time.Time)
SetNextRecover sets NextRecover field of StressChaos
func (in *StressChaos) SetNextStart(t time.Time)
SetNextStart sets NextStart field of StressChaos
func (in *StressChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setups StressChaos's webhook with manager
func (in *StressChaos) Validate() error
Validate validates chaos object
func (in *StressChaos) ValidateCreate() error
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *StressChaos) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *StressChaos) ValidatePodMode(spec *field.Path) field.ErrorList
ValidatePodMode validates the value with podmode
func (in *StressChaos) ValidateScheduler(spec *field.Path) field.ErrorList
ValidateScheduler validates whether scheduler is well defined
func (in *StressChaos) ValidateUpdate(old runtime.Object) error
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
StressChaosList contains a list of StressChaos
type StressChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []StressChaos `json:"items"` }
func (in *StressChaosList) DeepCopy() *StressChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StressChaosList.
func (in *StressChaosList) DeepCopyInto(out *StressChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StressChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *StressChaosList) ListChaos() []*ChaosInstance
ListChaos returns a list of stress chaos
StressChaosSpec defines the desired state of StressChaos
type StressChaosSpec struct { // Mode defines the mode to run chaos action. // Supported mode: one / all / fixed / fixed-percent / random-max-percent Mode PodMode `json:"mode"` // Value is required when the mode is set to `FixedPodMode` / `FixedPercentPodMod` / `RandomMaxPercentPodMod`. // If `FixedPodMode`, provide an integer of pods to do chaos action. // If `FixedPercentPodMod`, provide a number from 0-100 to specify the max % of pods the server can do chaos action. // If `RandomMaxPercentPodMod`, provide a number from 0-100 to specify the % of pods to do chaos action // +optional Value string `json:"value"` // Selector is used to select pods that are used to inject chaos action. Selector SelectorSpec `json:"selector"` // 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. // +optional Stressors *Stressors `json:"stressors,omitempty"` // 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. // +optional StressngStressors string `json:"stressngStressors,omitempty"` // ContainerName indicates the target container to inject stress in // +optional ContainerName *string `json:"containerName,omitempty"` // Duration represents the duration of the chaos action // +optional Duration *string `json:"duration,omitempty"` // Scheduler defines some schedule rules to control the running time of the chaos experiment about time. // +optional Scheduler *SchedulerSpec `json:"scheduler,omitempty"` }
func (in *StressChaosSpec) DeepCopy() *StressChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StressChaosSpec.
func (in *StressChaosSpec) DeepCopyInto(out *StressChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *StressChaosSpec) GetMode() PodMode
GetMode is a getter for Mode (for implementing SelectSpec)
func (in *StressChaosSpec) GetSelector() SelectorSpec
GetSelector is a getter for Selector (for implementing SelectSpec)
func (in *StressChaosSpec) GetValue() string
GetValue is a getter for Value (for implementing SelectSpec)
func (in *StressChaosSpec) Validate(parent *field.Path) field.ErrorList
Validate validates the scheduler and duration
StressChaosStatus defines the observed state of StressChaos
type StressChaosStatus struct { ChaosStatus `json:",inline"` // Instances always specifies stressing instances // +optional Instances map[string]StressInstance `json:"instances,omitempty"` }
func (in *StressChaosStatus) DeepCopy() *StressChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StressChaosStatus.
func (in *StressChaosStatus) DeepCopyInto(out *StressChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
StressInstance is an instance generates stresses
type StressInstance struct { // UID is the instance identifier // +optional UID string `json:"uid"` // StartTime specifies when the instance starts // +optional StartTime *metav1.Time `json:"startTime"` }
func (in *StressInstance) DeepCopy() *StressInstance
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StressInstance.
func (in *StressInstance) DeepCopyInto(out *StressInstance)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Stressor defines common configurations of a stressor
type Stressor struct { // Workers specifies N workers to apply the stressor. Workers int `json:"workers"` }
func (in *Stressor) DeepCopy() *Stressor
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stressor.
func (in *Stressor) DeepCopyInto(out *Stressor)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Stressor) Validate(parent *field.Path) field.ErrorList
Validate validates whether the Stressor is well defined
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
type Stressors struct { // MemoryStressor stresses virtual memory out // +optional MemoryStressor *MemoryStressor `json:"memory,omitempty"` // CPUStressor stresses CPU out // +optional CPUStressor *CPUStressor `json:"cpu,omitempty"` }
func (in *Stressors) DeepCopy() *Stressors
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Stressors.
func (in *Stressors) DeepCopyInto(out *Stressors)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Stressors) Normalize() (string, error)
Normalize the stressors to comply with stress-ng
func (in *Stressors) Validate(parent *field.Path) field.ErrorList
Validate validates whether the Stressors are all well defined
Target represents network partition and netem action target.
type Target struct { // TargetSelector defines the target selector TargetSelector SelectorSpec `json:"selector"` // TargetMode defines the target selector mode // +kubebuilder:validation:Enum=one;all;fixed;fixed-percent;random-max-percent;"" TargetMode PodMode `json:"mode"` // TargetValue is required when the mode is set to `FixedPodMode` / `FixedPercentPodMod` / `RandomMaxPercentPodMod`. // If `FixedPodMode`, provide an integer of pods to do chaos action. // If `FixedPercentPodMod`, provide a number from 0-100 to specify the percent of pods the server can do chaos action. // If `RandomMaxPercentPodMod`, provide a number from 0-100 to specify the max percent of pods to do chaos action // +optional TargetValue string `json:"value"` }
func (in *Target) DeepCopy() *Target
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Target.
func (in *Target) DeepCopyInto(out *Target)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Target) GetMode() PodMode
GetMode is a getter for Mode (for implementing SelectSpec)
func (in *Target) GetSelector() SelectorSpec
GetSelector is a getter for Selector (for implementing SelectSpec)
func (in *Target) GetValue() string
GetValue is a getter for Value (for implementing SelectSpec)
TcParameter represents the parameters for a traffic control chaos
type TcParameter struct { // Delay represents the detail about delay action // +optional Delay *DelaySpec `json:"delay,omitempty"` // Loss represents the detail about loss action // +optional Loss *LossSpec `json:"loss,omitempty"` // DuplicateSpec represents the detail about loss action // +optional Duplicate *DuplicateSpec `json:"duplicate,omitempty"` // Corrupt represents the detail about corrupt action // +optional Corrupt *CorruptSpec `json:"corrupt,omitempty"` // Bandwidth represents the detail about bandwidth control action // +optional Bandwidth *BandwidthSpec `json:"bandwidth,omitempty"` }
func (in *TcParameter) DeepCopy() *TcParameter
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TcParameter.
func (in *TcParameter) DeepCopyInto(out *TcParameter)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
TcType the type of traffic control
type TcType string
const ( // Netem represents netem traffic control Netem TcType = "netem" // Bandwidth represents bandwidth shape traffic control Bandwidth TcType = "bandwidth" )
TimeChaos is the Schema for the timechaos API
type TimeChaos struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` // Spec defines the behavior of a time chaos experiment Spec TimeChaosSpec `json:"spec"` // +optional // Most recently observed status of the time chaos experiment Status TimeChaosStatus `json:"status"` }
func (in *TimeChaos) DeepCopy() *TimeChaos
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeChaos.
func (in *TimeChaos) DeepCopyInto(out *TimeChaos)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimeChaos) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *TimeChaos) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (in *TimeChaos) GetChaos() *ChaosInstance
GetChaos returns a chaos instance
func (in *TimeChaos) GetDuration() (*time.Duration, error)
GetDuration gets the duration of TimeChaos
func (in *TimeChaos) GetNextRecover() time.Time
GetNextRecover get NextRecover field of TimeChaos
func (in *TimeChaos) GetNextStart() time.Time
GetNextStart gets NextStart field of TimeChaos
func (in *TimeChaos) GetScheduler() *SchedulerSpec
GetScheduler returns the scheduler of TimeChaos
func (in *TimeChaos) GetStatus() *ChaosStatus
GetStatus returns the status of TimeChaos
func (in *TimeChaos) IsDeleted() bool
IsDeleted returns whether this resource has been deleted
func (in *TimeChaos) IsPaused() bool
IsPaused returns whether this resource has been paused
func (in *TimeChaos) SetDefaultValue()
SetDefaultValue will set default value for empty fields
func (in *TimeChaos) SetNextRecover(t time.Time)
SetNextRecover sets NextRecover field of TimeChaos
func (in *TimeChaos) SetNextStart(t time.Time)
SetNextStart sets NextStart field of TimeChaos
func (in *TimeChaos) SetupWebhookWithManager(mgr ctrl.Manager) error
SetupWebhookWithManager setup TimeChaos's webhook with manager
func (in *TimeChaos) Validate() error
Validate validates chaos object
func (in *TimeChaos) ValidateCreate() error
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (in *TimeChaos) ValidateDelete() error
ValidateDelete implements webhook.Validator so a webhook will be registered for the type
func (in *TimeChaos) ValidatePodMode(spec *field.Path) field.ErrorList
ValidatePodMode validates the value with podmode
func (in *TimeChaos) ValidateScheduler(spec *field.Path) field.ErrorList
ValidateScheduler validates the scheduler and duration
func (in *TimeChaos) ValidateUpdate(old runtime.Object) error
ValidateUpdate implements webhook.Validator so a webhook will be registered for the type
TimeChaosList contains a list of TimeChaos
type TimeChaosList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []TimeChaos `json:"items"` }
func (in *TimeChaosList) DeepCopy() *TimeChaosList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeChaosList.
func (in *TimeChaosList) DeepCopyInto(out *TimeChaosList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimeChaosList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in *TimeChaosList) ListChaos() []*ChaosInstance
ListChaos returns a list of time chaos
TimeChaosSpec defines the desired state of TimeChaos
type TimeChaosSpec struct { // Mode defines the mode to run chaos action. // Supported mode: one / all / fixed / fixed-percent / random-max-percent // +kubebuilder:validation:Enum=one;all;fixed;fixed-percent;random-max-percent Mode PodMode `json:"mode"` // Value is required when the mode is set to `FixedPodMode` / `FixedPercentPodMod` / `RandomMaxPercentPodMod`. // If `FixedPodMode`, provide an integer of pods to do chaos action. // If `FixedPercentPodMod`, provide a number from 0-100 to specify the percent of pods the server can do chaos action. // If `RandomMaxPercentPodMod`, provide a number from 0-100 to specify the max percent of pods to do chaos action // +optional Value string `json:"value"` // Selector is used to select pods that are used to inject chaos action. Selector SelectorSpec `json:"selector"` // 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". TimeOffset string `json:"timeOffset"` // 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"] ClockIds []string `json:"clockIds,omitempty"` // ContainerName indicates the name of affected container. // If not set, all containers will be injected // +optional ContainerNames []string `json:"containerNames,omitempty"` // Duration represents the duration of the chaos action Duration *string `json:"duration,omitempty"` // Scheduler defines some schedule rules to control the running time of the chaos experiment about time. Scheduler *SchedulerSpec `json:"scheduler,omitempty"` }
func (in *TimeChaosSpec) DeepCopy() *TimeChaosSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeChaosSpec.
func (in *TimeChaosSpec) DeepCopyInto(out *TimeChaosSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *TimeChaosSpec) DefaultClockIds()
DefaultClockIds will set default value for empty ClockIds fields
func (in *TimeChaosSpec) GetMode() PodMode
GetMode is a getter for Mode (for implementing SelectSpec)
func (in *TimeChaosSpec) GetSelector() SelectorSpec
GetSelector is a getter for Selector (for implementing SelectSpec)
func (in *TimeChaosSpec) GetValue() string
GetValue is a getter for Value (for implementing SelectSpec)
TimeChaosStatus defines the observed state of TimeChaos
type TimeChaosStatus struct { ChaosStatus `json:",inline"` }
func (in *TimeChaosStatus) DeepCopy() *TimeChaosStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TimeChaosStatus.
func (in *TimeChaosStatus) DeepCopyInto(out *TimeChaosStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Timespec represents a time
type Timespec struct { Sec int64 `json:"sec"` Nsec int64 `json:"nsec"` }
func (in *Timespec) DeepCopy() *Timespec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Timespec.
func (in *Timespec) DeepCopyInto(out *Timespec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Validateable defines how a resource is validated
type Validateable interface { Validate(parent *field.Path) field.ErrorList }