v1beta1

package
v0.0.0-...-e050086 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 50 Imported by: 1

Documentation

Overview

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc.

Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. This product includes software developed at Datadog (https://www.datadoghq.com/). Copyright 2024 Datadog, Inc. +groupName=chaos.datadoghq.com

Package v1beta1 contains API Schema definitions for the chaos v1beta1 API group +kubebuilder:object:generate=true +groupName=chaos.datadoghq.com

Index

Constants

View Source
const (
	EventOnTargetTemplate     string = "Failing probably caused by disruption %s: "
	SourceDisruptionComponent string = "disruption-controller"
)
View Source
const (
	// FlowEgress is the string representation of network disruptions applied to outgoing packets
	FlowEgress = "egress"
	// FlowIngress is the string representation of network disruptions applied to incoming packets
	FlowIngress = "ingress"
	// this limitation does not come from TC itself but from the net scheduler of the kernel.
	// When not specifying an index for the hashtable created when we use u32 filters, the default id for this hashtable is 0x800.
	// However, the maximum id being 0xFFF, we can only have 2048 different ids, so 2048 tc filters with u32.
	// https://github.com/torvalds/linux/blob/v5.19/net/sched/cls_u32.c#L689-L690
	MaximumTCFilters             = 2048
	MaxNetworkPathCharacters     = 90
	MaxNetworkPaths              = 20
	MaxNetworkMethods            = 9
	DefaultHTTPPathFilter        = "/"
	HTTPMethodsFilterErrorPrefix = "the methods specification at the network disruption level is not valid; "
	HTTPPathsFilterErrorPrefix   = "the paths specification at the network disruption level is not valid; "
)
View Source
const APIVersion = "v1beta1"

APIVersion is exported for client-go purposes

View Source
const DisruptionKind = "Disruption"

DisruptionKind is the disruption kind

View Source
const ERROR = "error"

ERROR represents the type of gRPC alteration where a response is spoofed with a gRPC error code

View Source
const GroupName = chaostypes.GroupName

GroupName is exported for client-go purposes

View Source
const MaxDiskPathCharacters = 62

MaxDiskPathCharacters is used to limit the number of characters due to the eBPF memory kernel limitation.

View Source
const MaxHistoryLen = 5
View Source
const OVERRIDE = "override"

OVERRIDE represents the type of gRPC alteration where a response is spoofed with a specified return value

View Source
const SafemodeEnvironmentAnnotation = GroupName + "/environment"

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: GroupName, Version: APIVersion}

	// 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

	// TypeMeta is the Disruption Type Meta to create a disruption
	TypeMeta = metav1.TypeMeta{
		Kind:       DisruptionKind,
		APIVersion: GroupVersion.Identifier(),
	}
)
View Source
var (
	// ClientSchemeBuilder is exported for client-go purposes
	ClientSchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
)
View Source
var EmbeddedChaosAPI embed.FS

EmbeddedChaosAPI includes the library so it can be statically exported to chaosli

View Source
var (
	// ErrNoSpanContext is the error returned when the annotation does not contains expected span context key
	ErrNoSpanContext = fmt.Errorf("span context not found in disruption annotations")
)
View Source
var (
	// ErrNoUserInfo is the error returned when the annotation does not contains expected user info key
	ErrNoUserInfo = fmt.Errorf("user info not found in disruption annotations")
)
View Source
var ErrorMap = map[string]codes.Code{
	"OK":                  codes.OK,
	"CANCELED":            codes.Canceled,
	"UNKNOWN":             codes.Unknown,
	"INVALID_ARGUMENT":    codes.InvalidArgument,
	"DEADLINE_EXCEEDED":   codes.DeadlineExceeded,
	"NOT_FOUND":           codes.NotFound,
	"ALREADY_EXISTS":      codes.AlreadyExists,
	"PERMISSION_DENIED":   codes.PermissionDenied,
	"RESOURCE_EXHAUSTED":  codes.ResourceExhausted,
	"FAILED_PRECONDITION": codes.FailedPrecondition,
	"ABORTED":             codes.Aborted,
	"OUT_OF_RANGE":        codes.OutOfRange,
	"UNIMPLEMENTED":       codes.Unimplemented,
	"INTERNAL":            codes.Internal,
	"UNAVAILABLE":         codes.Unavailable,
	"DATA_LOSS":           codes.DataLoss,
	"UNAUTHENTICATED":     codes.Unauthenticated,
}

ErrorMap is a mapping from string representation of gRPC error to the official error code

View Source
var Events = map[DisruptionEventReason]DisruptionEvent{
	EventTargetPodWarningState: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetPodWarningState,
		OnDisruptionTemplateMessage:    "Targeted pod %s is failing",
		OnDisruptionTemplateAggMessage: "Targeted pod(s) are failing",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "pod is failing",
		Category:                       TargetEvent,
	},
	EventTargetContainerWarningState: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetContainerWarningState,
		OnDisruptionTemplateMessage:    "Container on targeted pod %s is failing",
		OnDisruptionTemplateAggMessage: "Containers on targeted pod(s) are failing",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "containers on pod are failing",
		Category:                       TargetEvent,
	},
	EventTargetLivenessProbeChange: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetLivenessProbeChange,
		OnDisruptionTemplateMessage:    "Liveness probe on targeted pod %s are failing",
		OnDisruptionTemplateAggMessage: "Liveness probe(s) on targeted pod(s) are failing",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "liveness probes on pod are failing",
		Category:                       TargetEvent,
	}, EventTargetReadinessProbeChangeDuringDisruption: {
		Type:                           corev1.EventTypeNormal,
		Reason:                         EventTargetReadinessProbeChangeDuringDisruption,
		OnDisruptionTemplateMessage:    "Readiness probe on targeted pod %s is failing",
		OnDisruptionTemplateAggMessage: "Readiness probes on targeted pod(s) are failing",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "readiness probes on pod are failing",
		Category:                       TargetEvent,
	}, EventTargetReadinessProbeChangeBeforeDisruption: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetReadinessProbeChangeBeforeDisruption,
		OnDisruptionTemplateMessage:    "Readiness probe on targeted pod %s is failing",
		OnDisruptionTemplateAggMessage: "Readiness probes on targeted pod(s) are failing",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "readiness probes on pod are failing",
		Category:                       TargetEvent,
	},
	EventTargetTooManyRestarts: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetTooManyRestarts,
		OnDisruptionTemplateMessage:    "Targeted pod %s has restarted too many times",
		OnDisruptionTemplateAggMessage: "Targeted pod(s) have restarted too many times",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "pod has restarted too many times",
		Category:                       TargetEvent,
	},
	EventTargetPodRecoveredState: {
		Type:                           corev1.EventTypeNormal,
		Reason:                         EventTargetPodRecoveredState,
		OnDisruptionTemplateMessage:    "Targeted pod %s seems to have recovered",
		OnDisruptionTemplateAggMessage: "Targeted pod(s) seem to have recovered",
		OnTargetTemplateMessage:        "pod seems to have recovered from the disruption %s failure",
		Category:                       TargetEvent,
	},
	EventTargetNodeMemPressureState: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetNodeMemPressureState,
		OnDisruptionTemplateMessage:    "Targeted node %s is under memory pressure",
		OnDisruptionTemplateAggMessage: "Targeted node(s) are under memory pressure",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "node is under memory pressure",
		Category:                       TargetEvent,
	},
	EventTargetNodeDiskPressureState: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetNodeDiskPressureState,
		OnDisruptionTemplateMessage:    "Targeted node %s is under disk pressure",
		OnDisruptionTemplateAggMessage: "Targeted node(s) are under disk pressure",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "node is under disk pressure",
		Category:                       TargetEvent,
	},
	EventTargetNodeUnavailableNetworkState: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetNodeUnavailableNetworkState,
		OnDisruptionTemplateMessage:    "Targeted node %s network is unavailable",
		OnDisruptionTemplateAggMessage: "Targeted node(s) network are unavailable",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "node network is unavaialble",
		Category:                       TargetEvent,
	},
	EventTargetNodeWarningState: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventTargetNodeWarningState,
		OnDisruptionTemplateMessage:    "Targeted node %s is not ready",
		OnDisruptionTemplateAggMessage: "Targeted node(s) are not ready",
		OnTargetTemplateMessage:        EventOnTargetTemplate + "node is not ready",
		Category:                       TargetEvent,
	},
	EventTargetNodeRecoveredState: {
		Type:                           corev1.EventTypeNormal,
		Reason:                         EventTargetNodeRecoveredState,
		OnDisruptionTemplateMessage:    "Targeted node %s seems to have recovered",
		OnDisruptionTemplateAggMessage: "Targeted node(s) seem to have recovered",
		OnTargetTemplateMessage:        "Node seems to have recovered from the disruption %s failure",
		Category:                       TargetEvent,
	},
	EventDisruptionDurationOver: {
		Type:                        corev1.EventTypeNormal,
		Reason:                      EventDisruptionDurationOver,
		OnDisruptionTemplateMessage: "The disruption has lived longer than its specified duration, and will be deleted in %s.",
		Category:                    DisruptEvent,
	},
	EventDisruptionGCOver: {
		Type:                        corev1.EventTypeNormal,
		Reason:                      EventDisruptionGCOver,
		OnDisruptionTemplateMessage: "The disruption has lived %s longer than its specified duration, and will now be deleted.",
		Category:                    DisruptEvent,
	},
	EventEmptyDisruption: {
		Type:                        corev1.EventTypeWarning,
		Reason:                      EventEmptyDisruption,
		OnDisruptionTemplateMessage: "No disruption recognized for \"%s\" therefore no disruption applied.",
		Category:                    DisruptEvent,
	},
	EventDisruptionCreationFailed: {
		Type:                        corev1.EventTypeWarning,
		Reason:                      EventDisruptionCreationFailed,
		OnDisruptionTemplateMessage: "Injection pod for disruption \"%s\" failed to be created",
		Category:                    DisruptEvent,
	},
	EventDisruptionStuckOnRemoval: {
		Type:                        corev1.EventTypeWarning,
		Reason:                      EventDisruptionStuckOnRemoval,
		OnDisruptionTemplateMessage: "Instance is stuck on removal because of chaos pods not being able to terminate correctly, please check pods logs before manually removing their finalizer. https://github.com/DataDog/chaos-controller/blob/main/docs/faq.md",
		Category:                    DisruptEvent,
	},
	EventInvalidDisruptionLabelSelector: {
		Type:                        corev1.EventTypeWarning,
		Reason:                      EventInvalidDisruptionLabelSelector,
		OnDisruptionTemplateMessage: "%s. No targets will be selected.",
		Category:                    DisruptEvent,
	},
	EventDisruptionNoMoreValidTargets: {
		Type:                        corev1.EventTypeNormal,
		Reason:                      EventDisruptionNoMoreValidTargets,
		OnDisruptionTemplateMessage: "No more targets found for injection for this disruption (either ignored or already targeted by another disruption)",
		Category:                    DisruptEvent,
	},
	EventDisruptionNoTargetsFound: {
		Type:                        corev1.EventTypeWarning,
		Reason:                      EventDisruptionNoTargetsFound,
		OnDisruptionTemplateMessage: "The given label selector did not return any targets. Please ensure that both the selector and the count are correct (should be either a percentage or an integer greater than 0).",
		Category:                    DisruptEvent,
	},
	EventInvalidSpecDisruption: {
		Type:                        corev1.EventTypeWarning,
		Reason:                      EventInvalidSpecDisruption,
		OnDisruptionTemplateMessage: "%s",
		Category:                    DisruptEvent,
	},
	EventDisruptionChaosPodCreated: {
		Type:                        corev1.EventTypeNormal,
		Reason:                      EventDisruptionChaosPodCreated,
		OnDisruptionTemplateMessage: "Created disruption injection pod for \"%s\"",
		Category:                    DisruptEvent,
	},
	EventDisruptionCreated: {
		Type:                        corev1.EventTypeNormal,
		Reason:                      EventDisruptionCreated,
		OnDisruptionTemplateMessage: "Disruption created",
		Category:                    DisruptEvent,
	},
	EventDisruptionFinished: {
		Type:                        corev1.EventTypeNormal,
		Reason:                      EventDisruptionFinished,
		OnDisruptionTemplateMessage: "Disruption finished",
		Category:                    DisruptEvent,
	},
	EventDisrupted: {
		Type:                    corev1.EventTypeNormal,
		Reason:                  EventDisrupted,
		OnTargetTemplateMessage: "Pod %s from disruption %s targeted this resource for injection",
		Category:                DisruptEvent,
	},
	EventChaosPodFailedState: {
		Type:                           corev1.EventTypeWarning,
		Reason:                         EventChaosPodFailedState,
		OnDisruptionTemplateMessage:    "Chaos pod %s is not ready. Phase: '%s'. Reason: '%s'",
		OnDisruptionTemplateAggMessage: "Chaos pod(s) are not ready",
		Category:                       ChaosPodEvent,
	},
}

NoSideEffectDisruptions is the list of all disruption kinds where the lifecycle of the failure matches the lifecycle of the chaos pod. So once the chaos pod is gone, there's nothing left for us to clean.

Functions

func AdvancedSelectorsToRequirements

func AdvancedSelectorsToRequirements(advancedSelectors []metav1.LabelSelectorRequirement) ([]labels.Requirement, error)

AdvancedSelectorsToRequirements converts a slice of LabelSelectorRequirements into a slice of Requirements and returns an error if any of those LabelSelectorRequirements are invalid. It's used for translating user specified advanced selectors into real requirements for selecting targets

func DisruptionHasNoSideEffects

func DisruptionHasNoSideEffects(kind string) bool

func DisruptionIsNotReinjectable

func DisruptionIsNotReinjectable(kind chaostypes.DisruptionKindName) bool

func GetChaosPods

func GetChaosPods(ctx context.Context, log *zap.SugaredLogger, chaosNamespace string, k8sClient client.Client, instance *Disruption, ls labels.Set) ([]corev1.Pod, error)

GetChaosPods returns chaos pods owned by the given instance and having the given labels both instance and label set are optional but at least one must be provided

func GetIntOrPercentValueSafely

func GetIntOrPercentValueSafely(intOrStr *intstr.IntOrString) (int, bool, error)

GetIntOrPercentValueSafely has three return values. The first is the int value of intOrStr, and the second is if that int value is a percentage (true) or simply an integer (false).

func IsCompletionEvent

func IsCompletionEvent(event corev1.Event) bool

func IsNotifiableEvent

func IsNotifiableEvent(event corev1.Event) bool

IsNotifiableEvent this event can be broadcasted to our notifiers

func IsRecoveryEvent

func IsRecoveryEvent(event corev1.Event) bool

func IsTargetEvent

func IsTargetEvent(event corev1.Event) bool

func IsUpdateConflictError

func IsUpdateConflictError(err error) bool

IsUpdateConflictError tells us if this error is of the forms: "Operation cannot be fulfilled on disruptions.chaos.datadoghq.com "chaos-network-drop": the object has been modified; please apply your changes to the latest version and try again" "Operation cannot be fulfilled on disruptions.chaos.datadoghq.com "name": StorageError: invalid object, Code: 4, Key: /registry/chaos.datadoghq.com/disruptions/namespace/name, ResourceVersion: 0, AdditionalErrorMsg: Precondition failed: UID in precondition: 3534199c-2597-443e-ae59-92e003310d64, UID in object meta:" Sadly this doesn't seem to be one of the errors checkable with a function from "k8s.io/apimachinery/pkg/api/errors" So we parse the error message directly

func ShouldSkipNodeFailureInjection

func ShouldSkipNodeFailureInjection(disKind chaostypes.DisruptionKindName, instance *Disruption, injection TargetInjection) bool

ShouldSkipNodeFailureInjection returns true if we are attempting to inject a node failure that has already been injected for this given target If we're using staticTargeting, we should never re-select a target whose InjectionStatus is anything other than NotInjected, as we may be injecting into a pod that has been rescheduled onto a new node

func TargetedContainers

func TargetedContainers(pod corev1.Pod, containerNames []string) (map[string]string, error)

TargetedContainers returns a map of containers with containerName as a key and containerID in the format '<type>://<container_id>' as a value

func ValidateCount

func ValidateCount(count *intstr.IntOrString) error

Types

type CPUPressureSpec

type CPUPressureSpec struct {
	// Count represents the number of cores to target
	// either an integer form or a percentage form appended with a %
	// if empty, it will be considered to be 100%
	Count *intstr.IntOrString `json:"count,omitempty"`
}

CPUPressureSpec represents a cpu pressure disruption

func (*CPUPressureSpec) DeepCopy

func (in *CPUPressureSpec) DeepCopy() *CPUPressureSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CPUPressureSpec.

func (*CPUPressureSpec) DeepCopyInto

func (in *CPUPressureSpec) DeepCopyInto(out *CPUPressureSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*CPUPressureSpec) GenerateArgs

func (s *CPUPressureSpec) GenerateArgs() []string

GenerateArgs generates injection or cleanup pod arguments for the given spec

func (*CPUPressureSpec) Validate

func (s *CPUPressureSpec) Validate() (retErr error)

Validate validates args for the given disruption

type Config

type Config struct {
	CountTooLarge *CountTooLargeConfig `json:"countTooLarge,omitempty"`
}

Config represents any configurable parameters for the safetynets, all of which have defaults

func (*Config) DeepCopy

func (in *Config) DeepCopy() *Config

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.

func (*Config) DeepCopyInto

func (in *Config) DeepCopyInto(out *Config)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ContainerFailureSpec

type ContainerFailureSpec struct {
	Forced bool `json:"forced,omitempty"`
}

ContainerFailureSpec represents a container failure injection

func (*ContainerFailureSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ContainerFailureSpec.

func (*ContainerFailureSpec) DeepCopyInto

func (in *ContainerFailureSpec) DeepCopyInto(out *ContainerFailureSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ContainerFailureSpec) GenerateArgs

func (s *ContainerFailureSpec) GenerateArgs() []string

GenerateArgs generates injection or cleanup pod arguments for the given spec

func (*ContainerFailureSpec) Validate

func (s *ContainerFailureSpec) Validate() error

Validate validates args for the given disruption

type CountTooLargeConfig

type CountTooLargeConfig struct {
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=100
	// +ddmark:validation:Minimum=1
	// +ddmark:validation:Maximum=100
	NamespaceThreshold *int `json:"namespaceThreshold,omitempty"`
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=100
	// +ddmark:validation:Minimum=1
	// +ddmark:validation:Maximum=100
	ClusterThreshold *int `json:"clusterThreshold,omitempty"`
}

CountTooLargeConfig represents the configuration for the countTooLarge safetynet +ddmark:validation:AtLeastOneOf={NamespaceThreshold,ClusterThreshold}

func (*CountTooLargeConfig) DeepCopy

func (in *CountTooLargeConfig) DeepCopy() *CountTooLargeConfig

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CountTooLargeConfig.

func (*CountTooLargeConfig) DeepCopyInto

func (in *CountTooLargeConfig) DeepCopyInto(out *CountTooLargeConfig)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DNSDisruptionSpec

type DNSDisruptionSpec []HostRecordPair

DNSDisruptionSpec represents a dns disruption

func (DNSDisruptionSpec) DeepCopy

func (in DNSDisruptionSpec) DeepCopy() DNSDisruptionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSDisruptionSpec.

func (DNSDisruptionSpec) DeepCopyInto

func (in DNSDisruptionSpec) DeepCopyInto(out *DNSDisruptionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (DNSDisruptionSpec) GenerateArgs

func (s DNSDisruptionSpec) GenerateArgs() []string

GenerateArgs generates injection pod arguments for the given spec

func (DNSDisruptionSpec) Validate

func (s DNSDisruptionSpec) Validate() (retErr error)

Validate validates that there are no missing hostnames or records for the given dns disruption spec

type DNSRecord

type DNSRecord struct {
	Type  string `json:"type"`
	Value string `json:"value"`
}

DNSRecord represents a type of DNS Record, such as A or CNAME, and the value of that record

func (*DNSRecord) DeepCopy

func (in *DNSRecord) DeepCopy() *DNSRecord

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSRecord.

func (*DNSRecord) DeepCopyInto

func (in *DNSRecord) DeepCopyInto(out *DNSRecord)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DiskFailureSpec

type DiskFailureSpec struct {
	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	Paths []string `json:"paths"`
	// +nullable
	OpenatSyscall *OpenatSyscallSpec `json:"openat,omitempty"`
	Probability   string             `json:"probability,omitempty"`
}

DiskFailureSpec represents a disk failure disruption

func (*DiskFailureSpec) DeepCopy

func (in *DiskFailureSpec) DeepCopy() *DiskFailureSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskFailureSpec.

func (*DiskFailureSpec) DeepCopyInto

func (in *DiskFailureSpec) DeepCopyInto(out *DiskFailureSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DiskFailureSpec) GenerateArgs

func (s *DiskFailureSpec) GenerateArgs() (args []string)

GenerateArgs generates injection or cleanup pod arguments for the given spec

func (*DiskFailureSpec) Validate

func (s *DiskFailureSpec) Validate() (retErr error)

Validate validates args for the given disruption

type DiskPressureSpec

type DiskPressureSpec struct {
	Path string `json:"path"`
	// +ddmark:validation:Required=true
	Throttling DiskPressureThrottlingSpec `json:"throttling"`
}

DiskPressureSpec represents a disk pressure disruption

func (*DiskPressureSpec) DeepCopy

func (in *DiskPressureSpec) DeepCopy() *DiskPressureSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskPressureSpec.

func (*DiskPressureSpec) DeepCopyInto

func (in *DiskPressureSpec) DeepCopyInto(out *DiskPressureSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DiskPressureSpec) GenerateArgs

func (s *DiskPressureSpec) GenerateArgs() []string

GenerateArgs generates injection or cleanup pod arguments for the given spec

func (*DiskPressureSpec) Validate

func (s *DiskPressureSpec) Validate() error

Validate validates args for the given disruption

type DiskPressureThrottlingSpec

type DiskPressureThrottlingSpec struct {
	ReadBytesPerSec  *int `json:"readBytesPerSec,omitempty"`
	WriteBytesPerSec *int `json:"writeBytesPerSec,omitempty"`
}

DiskPressureThrottlingSpec represents a throttle on read and write disk operations

func (*DiskPressureThrottlingSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskPressureThrottlingSpec.

func (*DiskPressureThrottlingSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type Disruption

type Disruption struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   DisruptionSpec   `json:"spec,omitempty"`
	Status DisruptionStatus `json:"status,omitempty"`
}

Disruption is the Schema for the disruptions API +kubebuilder:resource:shortName=dis +kubebuilder:subresource:status +genclient +genclient:noStatus +genclient:onlyVerbs=create,get,list,delete,watch

func ReadUnmarshal

func ReadUnmarshal(path string) (*Disruption, error)

func (*Disruption) DeepCopy

func (in *Disruption) DeepCopy() *Disruption

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Disruption.

func (*Disruption) DeepCopyInto

func (in *Disruption) DeepCopyInto(out *Disruption)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Disruption) DeepCopyObject

func (in *Disruption) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

func (*Disruption) Default

func (r *Disruption) Default()

Default implements webhook.Defaulter so a webhook will be registered for the type

func (*Disruption) GetTargetsCountAsInt

func (r *Disruption) GetTargetsCountAsInt(targetTotal int, roundUp bool) (int, error)

GetTargetsCountAsInt This function returns a scaled value from the spec.Count IntOrString type. If the count // is a percentage string value it's treated as a percentage and scaled appropriately // in accordance to the total, if it's an int value it's treated as a simple value and // if it is a string value which is either non-numeric or numeric but lacking a trailing '%' it returns an error.

func (*Disruption) IsDeletionExpired

func (r *Disruption) IsDeletionExpired(deletionTimeout time.Duration) bool

IsDeletionExpired checks if a Disruption resource has exceeded a specified deletion timeout duration for deletion. It returns true if the resource should be considered deleted based on the DeletionTimestamp and the deletion timeout duration.

func (*Disruption) RemainingDuration

func (r *Disruption) RemainingDuration() time.Duration

RemainingDuration return the remaining duration of the disruption.

func (*Disruption) SetSpanContext

func (r *Disruption) SetSpanContext(ctx context.Context) error

SetSpanContext store provided spanContext into expected disruption annotation

func (*Disruption) SetUserInfo

func (r *Disruption) SetUserInfo(userInfo v1.UserInfo) error

SetUserInfo store provided userInfo into expected disruption annotation

func (*Disruption) SetupWebhookWithManager

func (r *Disruption) SetupWebhookWithManager(setupWebhookConfig utils.SetupWebhookWithManagerConfig) error

func (*Disruption) SpanContext

func (r *Disruption) SpanContext(ctx context.Context) (context.Context, error)

SpanContext extracts this disruption's span context, injects it in the given context, then returns it

func (*Disruption) TerminationStatus

func (r *Disruption) TerminationStatus(chaosPods []corev1.Pod) TerminationStatus

TerminationStatus determines the termination status of a disruption based on various factors.

func (*Disruption) TimeToCreatePods

func (r *Disruption) TimeToCreatePods() time.Time

TimeToCreatePods takes the DisruptionTriggers field from a Disruption spec, along with the time.Time at which that disruption was created It returns the earliest time.Time at which the chaos-controller should begin creating chaos pods, given the specified DisruptionTriggers

func (*Disruption) TimeToInject

func (r *Disruption) TimeToInject() time.Time

TimeToInject calculates the time at which the disruption should be injected based on its own creationTimestamp. It considers the specified triggers for injection timing in the disruption's specification.

func (*Disruption) UserInfo

func (r *Disruption) UserInfo() (v1.UserInfo, error)

UserInfo returns extracted user info informations or an error if not available or invalid

func (*Disruption) ValidateCreate

func (r *Disruption) ValidateCreate() (admission.Warnings, error)

ValidateCreate implements webhook.Validator so a webhook will be registered for the type

func (*Disruption) ValidateDelete

func (r *Disruption) ValidateDelete() (admission.Warnings, error)

ValidateDelete implements webhook.Validator so a webhook will be registered for the type

func (*Disruption) ValidateUpdate

func (r *Disruption) ValidateUpdate(old runtime.Object) (admission.Warnings, error)

ValidateUpdate implements webhook.Validator so a webhook will be registered for the type

type DisruptionCron

type DisruptionCron struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DisruptionCronSpec   `json:"spec,omitempty"`
	Status            DisruptionCronStatus `json:"status,omitempty"`
}

DisruptionCron is the Schema for the disruptioncron API +kubebuilder:resource:shortName=dicron +kubebuilder:subresource:status +genclient +genclient:noStatus +genclient:onlyVerbs=create,get,list,delete,watch

func (*DisruptionCron) DeepCopy

func (in *DisruptionCron) DeepCopy() *DisruptionCron

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionCron.

func (*DisruptionCron) DeepCopyInto

func (in *DisruptionCron) DeepCopyInto(out *DisruptionCron)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DisruptionCron) DeepCopyObject

func (in *DisruptionCron) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DisruptionCronList

type DisruptionCronList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DisruptionCron `json:"items"`
}

DisruptionCronList contains a list of DisruptionCron

func (*DisruptionCronList) DeepCopy

func (in *DisruptionCronList) DeepCopy() *DisruptionCronList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionCronList.

func (*DisruptionCronList) DeepCopyInto

func (in *DisruptionCronList) DeepCopyInto(out *DisruptionCronList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DisruptionCronList) DeepCopyObject

func (in *DisruptionCronList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DisruptionCronSpec

type DisruptionCronSpec struct {
	// +kubebuilder:validation:MinLength=0
	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	// The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron.
	Schedule string `json:"schedule"`

	// Optional deadline for starting the disruption if it misses scheduled time
	// for any reason.  Missed disruption executions will be counted as failed ones.
	// +nullable
	DelayedStartTolerance DisruptionDuration `json:"delayedStartTolerance,omitempty"`

	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	// TargetResource specifies the resource to run disruptions against.
	// It can only be a deployment or statefulset.
	TargetResource TargetResourceSpec `json:"targetResource"`

	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	// Specifies the Disruption that will be created when executing a disruptioncron.
	DisruptionTemplate DisruptionSpec `json:"disruptionTemplate"`
}

DisruptionCronSpec defines the desired state of DisruptionCron

func (*DisruptionCronSpec) DeepCopy

func (in *DisruptionCronSpec) DeepCopy() *DisruptionCronSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionCronSpec.

func (*DisruptionCronSpec) DeepCopyInto

func (in *DisruptionCronSpec) DeepCopyInto(out *DisruptionCronSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionCronStatus

type DisruptionCronStatus struct {
	// The last time when the disruption was last successfully scheduled.
	// +nullable
	LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`

	// Time when the target resource was previously missing.
	// +nullable
	TargetResourcePreviouslyMissing *metav1.Time `json:"targetResourcePreviouslyMissing,omitempty"`

	History []DisruptionCronTrigger `json:"history,omitempty"`
}

DisruptionCronStatus defines the observed state of DisruptionCron

func (*DisruptionCronStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionCronStatus.

func (*DisruptionCronStatus) DeepCopyInto

func (in *DisruptionCronStatus) DeepCopyInto(out *DisruptionCronStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionCronTrigger

type DisruptionCronTrigger struct {
	Name      string      `json:"name,omitempty"`
	Kind      string      `json:"kind,omitempty"`
	CreatedAt metav1.Time `json:"createdAt,omitempty"`
}

func (*DisruptionCronTrigger) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionCronTrigger.

func (*DisruptionCronTrigger) DeepCopyInto

func (in *DisruptionCronTrigger) DeepCopyInto(out *DisruptionCronTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionDuration

type DisruptionDuration string

func (DisruptionDuration) Duration

func (dd DisruptionDuration) Duration() time.Duration

func (DisruptionDuration) MarshalJSON

func (dd DisruptionDuration) MarshalJSON() ([]byte, error)

func (*DisruptionDuration) UnmarshalJSON

func (dd *DisruptionDuration) UnmarshalJSON(data []byte) error

type DisruptionEvent

type DisruptionEvent struct {
	Type                           string                  // Warning or Normal
	Reason                         DisruptionEventReason   // Short description of the event
	OnTargetTemplateMessage        string                  // Template message to attach to the target resource (pod or node). Empty if the event should not be sent to a target (DisruptEvent only)
	OnDisruptionTemplateMessage    string                  // We want to separate the aggregated message from the single message to include more info in the single message
	OnDisruptionTemplateAggMessage string                  // Template message to attach to the disruption. Empty if the event should not be sent on a disruption
	Category                       DisruptionEventCategory // Either TargetEvent, DisruptionEvent or ChaosPodEvent
}

func (*DisruptionEvent) DeepCopy

func (in *DisruptionEvent) DeepCopy() *DisruptionEvent

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionEvent.

func (*DisruptionEvent) DeepCopyInto

func (in *DisruptionEvent) DeepCopyInto(out *DisruptionEvent)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionEventCategory

type DisruptionEventCategory string
const (
	// Event only attached to a target
	TargetEvent DisruptionEventCategory = "TargetEvent"
	// Event only attached to the disruption
	DisruptEvent DisruptionEventCategory = "DisruptionEvent"
	// Event only attached to a chaos pod
	ChaosPodEvent DisruptionEventCategory = "ChaosPodEvent"
)

type DisruptionEventReason

type DisruptionEventReason string

DisruptionEventReason is the string that uniquely identify a disruption event

const (
	// Targeted pods related
	// Warning events
	EventTargetPodWarningState                      DisruptionEventReason = "TargetPodInWarningState"
	EventTargetContainerWarningState                DisruptionEventReason = "TargetPodContainersInWarningState"
	EventTargetLivenessProbeChange                  DisruptionEventReason = "TargetPodLivenessProbe"
	EventTargetTooManyRestarts                      DisruptionEventReason = "TargetPodTooManyRestarts"
	EventTargetReadinessProbeChangeBeforeDisruption DisruptionEventReason = "TargetReadinessProbeChangeBeforeDisruption"
	// Normal events
	EventTargetPodRecoveredState                    DisruptionEventReason = "RecoveredWarningStateInTargetPod"
	EventTargetReadinessProbeChangeDuringDisruption DisruptionEventReason = "ReadinessProbeChangeDuringDisruption"

	// Targeted nodes related
	// Warning events
	EventTargetNodeMemPressureState        DisruptionEventReason = "TargetNodeUnderMemoryPressure"
	EventTargetNodeDiskPressureState       DisruptionEventReason = "TargetNodeUnderDiskPressure"
	EventTargetNodeUnavailableNetworkState DisruptionEventReason = "TargetNodeUnavailableNetwork"
	EventTargetNodeWarningState            DisruptionEventReason = "TargetNodeInWarningState"
	// Normal events
	EventTargetNodeRecoveredState DisruptionEventReason = "RecoveredWarningStateInTargetNode"

	// Disruption related events
	// Warning events
	EventEmptyDisruption                DisruptionEventReason = "EmptyDisruption"
	EventDisruptionCreationFailed       DisruptionEventReason = "CreateFailed"
	EventDisruptionStuckOnRemoval       DisruptionEventReason = "StuckOnRemoval"
	EventInvalidDisruptionLabelSelector DisruptionEventReason = "InvalidLabelSelector"
	EventDisruptionNoMoreValidTargets   DisruptionEventReason = "NoMoreTargets"
	EventDisruptionNoTargetsFound       DisruptionEventReason = "NoTargetsFound"
	EventInvalidSpecDisruption          DisruptionEventReason = "InvalidSpec"
	// Normal events
	EventDisruptionChaosPodCreated DisruptionEventReason = "ChaosPodCreated"
	EventDisruptionFinished        DisruptionEventReason = "Finished"
	EventDisruptionCreated         DisruptionEventReason = "Created"
	EventDisruptionDurationOver    DisruptionEventReason = "DurationOver"
	EventDisruptionGCOver          DisruptionEventReason = "GCOver"
	EventDisrupted                 DisruptionEventReason = "Disrupted"

	// Injection related events
	// Warning events
	EventChaosPodFailedState DisruptionEventReason = "ChaosPodWarningState"
)

Complete list of events sent out by the controller

func (DisruptionEventReason) MatchEventReason

func (r DisruptionEventReason) MatchEventReason(e corev1.Event) bool

MatchEventReason check if provided Kubernetes event match actual reason

type DisruptionFilter

type DisruptionFilter struct {
	Annotations labels.Set `json:"annotations,omitempty"`
}

func (*DisruptionFilter) DeepCopy

func (in *DisruptionFilter) DeepCopy() *DisruptionFilter

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionFilter.

func (*DisruptionFilter) DeepCopyInto

func (in *DisruptionFilter) DeepCopyInto(out *DisruptionFilter)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionList

type DisruptionList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []Disruption `json:"items"`
}

DisruptionList contains a list of Disruption

func (*DisruptionList) DeepCopy

func (in *DisruptionList) DeepCopy() *DisruptionList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionList.

func (*DisruptionList) DeepCopyInto

func (in *DisruptionList) DeepCopyInto(out *DisruptionList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DisruptionList) DeepCopyObject

func (in *DisruptionList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DisruptionPulse

type DisruptionPulse struct {
	ActiveDuration  DisruptionDuration `json:"activeDuration,omitempty"`
	DormantDuration DisruptionDuration `json:"dormantDuration,omitempty"`
	InitialDelay    DisruptionDuration `json:"initialDelay,omitempty"`
}

DisruptionPulse contains the active disruption duration and the dormant disruption duration +ddmark:validation:LinkedFields={ActiveDuration,DormantDuration}

func (*DisruptionPulse) DeepCopy

func (in *DisruptionPulse) DeepCopy() *DisruptionPulse

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionPulse.

func (*DisruptionPulse) DeepCopyInto

func (in *DisruptionPulse) DeepCopyInto(out *DisruptionPulse)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionRollout

type DisruptionRollout struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	Spec              DisruptionRolloutSpec   `json:"spec,omitempty"`
	Status            DisruptionRolloutStatus `json:"status,omitempty"`
}

DisruptionRollout is the Schema for the disruptionrollout API +kubebuilder:resource:shortName=diroll +kubebuilder:subresource:status

func (*DisruptionRollout) DeepCopy

func (in *DisruptionRollout) DeepCopy() *DisruptionRollout

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionRollout.

func (*DisruptionRollout) DeepCopyInto

func (in *DisruptionRollout) DeepCopyInto(out *DisruptionRollout)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DisruptionRollout) DeepCopyObject

func (in *DisruptionRollout) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DisruptionRolloutList

type DisruptionRolloutList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []DisruptionRollout `json:"items"`
}

DisruptionRolloutList contains a list of DisruptionRollout

func (*DisruptionRolloutList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionRolloutList.

func (*DisruptionRolloutList) DeepCopyInto

func (in *DisruptionRolloutList) DeepCopyInto(out *DisruptionRolloutList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DisruptionRolloutList) DeepCopyObject

func (in *DisruptionRolloutList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type DisruptionRolloutSpec

type DisruptionRolloutSpec struct {
	// DelayedStartTolerance specifies the allowed deadline to start the disruption
	// after detecting a change in the target resource. If the disruption
	// does not start within this duration, the execution is considered failed.
	// +nullable
	DelayedStartTolerance DisruptionDuration `json:"delayedStartTolerance,omitempty"`

	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	// TargetResource specifies the resource to run disruptions against.
	// It can only be a deployment or statefulset.
	TargetResource TargetResourceSpec `json:"targetResource"`

	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	// Specifies the Disruption that will be created when executing a disruptionrollout.
	DisruptionTemplate DisruptionSpec `json:"disruptionTemplate"`
}

DisruptionRolloutSpec defines the desired state of DisruptionRollout

func (*DisruptionRolloutSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionRolloutSpec.

func (*DisruptionRolloutSpec) DeepCopyInto

func (in *DisruptionRolloutSpec) DeepCopyInto(out *DisruptionRolloutSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionRolloutStatus

type DisruptionRolloutStatus struct {
	// LatestInitContainersHash provides a map of the latest observed hashes for
	// each InitContainer of the TargetResource.
	// The key is the name of the InitContainer, and the value is its MD5 hash.
	// +nullable
	LatestInitContainersHash map[string]string `json:"latestInitContainersHash,omitempty"`

	// LatestContainersHash provides a map of the latest observed hashes for
	// each Container of the TargetResource.
	// The key is the name of the Container, and the value is its MD5 hash.
	// +nullable
	LatestContainersHash map[string]string `json:"latestContainersHash,omitempty"`

	// LastModificationTimestamp captures the time when a change in the containers
	// of the TargetResource was detected.
	// +nullable
	LastContainerChangeTime *metav1.Time `json:"lastContainerChangeTime,omitempty"`

	// The last time when the disruption was last successfully scheduled.
	// +nullable
	LastScheduleTime *metav1.Time `json:"lastScheduleTime,omitempty"`

	// Time when the target resource was previously missing.
	// +nullable
	TargetResourcePreviouslyMissing *metav1.Time `json:"targetResourcePreviouslyMissing,omitempty"`
}

DisruptionRolloutStatus defines the observed state of DisruptionRollout

func (*DisruptionRolloutStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionRolloutStatus.

func (*DisruptionRolloutStatus) DeepCopyInto

func (in *DisruptionRolloutStatus) DeepCopyInto(out *DisruptionRolloutStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DisruptionSpec

type DisruptionSpec struct {
	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	Count *intstr.IntOrString `json:"count"` // number of pods to target in either integer form or percent form appended with a %
	// AllowDisruptedTargets allow pods with one or several other active disruptions, with disruption kinds that does not intersect
	// with this disruption kinds, to be returned as part of eligible targets for this disruption
	// - e.g. apply a CPU pressure and later, apply a container failure for a short duration
	// NB: it's ALWAYS forbidden to apply the same disruption kind to the same target to avoid unreliable effects due to competing interactions
	AllowDisruptedTargets bool `json:"allowDisruptedTargets,omitempty"`
	// +nullable
	Selector labels.Set `json:"selector,omitempty"` // label selector
	// +nullable
	AdvancedSelector []metav1.LabelSelectorRequirement `json:"advancedSelector,omitempty"` // advanced label selector
	// +nullable
	Filter          *DisruptionFilter `json:"filter,omitempty"`
	DryRun          bool              `json:"dryRun,omitempty"`          // enable dry-run mode
	OnInit          bool              `json:"onInit,omitempty"`          // enable disruption on init
	Unsafemode      *UnsafemodeSpec   `json:"unsafeMode,omitempty"`      // unsafemode spec used to turn off safemode safety nets
	StaticTargeting bool              `json:"staticTargeting,omitempty"` // enable dynamic targeting and cluster observation
	// +nullable
	Triggers DisruptionTriggers `json:"triggers,omitempty"` // alter the pre-injection lifecycle
	// +nullable
	Pulse    *DisruptionPulse   `json:"pulse,omitempty"`    // enable pulsing diruptions and specify the duration of the active state and the dormant state of the pulsing duration
	Duration DisruptionDuration `json:"duration,omitempty"` // time from disruption creation until chaos pods are deleted and no more are created
	// Level defines what the disruption will target, either a pod or a node
	// +kubebuilder:default=pod
	// +kubebuilder:validation:Enum=pod;node
	// +ddmark:validation:Enum=pod;node
	Level      chaostypes.DisruptionLevel `json:"level,omitempty"`
	Containers []string                   `json:"containers,omitempty"`
	// +nullable
	Network *NetworkDisruptionSpec `json:"network,omitempty"`
	// +nullable
	NodeFailure *NodeFailureSpec `json:"nodeFailure,omitempty"`
	// +nullable
	ContainerFailure *ContainerFailureSpec `json:"containerFailure,omitempty"`
	// +nullable
	CPUPressure *CPUPressureSpec `json:"cpuPressure,omitempty"`
	// +nullable
	DiskPressure *DiskPressureSpec `json:"diskPressure,omitempty"`
	// +nullable
	DiskFailure *DiskFailureSpec `json:"diskFailure,omitempty"`
	// +nullable
	DNS DNSDisruptionSpec `json:"dns,omitempty"`
	// +nullable
	GRPC *GRPCDisruptionSpec `json:"grpc,omitempty"`
	// +nullable
	Reporting *Reporting `json:"reporting,omitempty"`
}

DisruptionSpec defines the desired state of Disruption +ddmark:validation:ExclusiveFields={ContainerFailure,CPUPressure,DiskPressure,NodeFailure,Network,DNS,DiskFailure} +ddmark:validation:ExclusiveFields={NodeFailure,CPUPressure,DiskPressure,ContainerFailure,Network,DNS,DiskFailure} +ddmark:validation:LinkedFieldsValueWithTrigger={NodeFailure,Level} +ddmark:validation:AtLeastOneOf={DNS,CPUPressure,Network,NodeFailure,ContainerFailure,DiskPressure,GRPC,DiskFailure} +ddmark:validation:AtLeastOneOf={Selector,AdvancedSelector}

func (*DisruptionSpec) DeepCopy

func (in *DisruptionSpec) DeepCopy() *DisruptionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionSpec.

func (*DisruptionSpec) DeepCopyInto

func (in *DisruptionSpec) DeepCopyInto(out *DisruptionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (DisruptionSpec) DisruptionCount

func (s DisruptionSpec) DisruptionCount() int

DisruptionCount get the number of disruption types per disruption

func (DisruptionSpec) DisruptionKindPicker

DisruptionKindPicker returns this DisruptionSpec's instance of a DisruptionKind based on given kind name

func (DisruptionSpec) Hash

func (s DisruptionSpec) Hash() (string, error)

Hash returns the disruption spec JSON hash

func (DisruptionSpec) HashNoCount

func (s DisruptionSpec) HashNoCount() (string, error)

func (DisruptionSpec) KindNames

KindNames returns the non-nil disruption kind names for the given disruption

func (*DisruptionSpec) UnmarshalJSON

func (s *DisruptionSpec) UnmarshalJSON(data []byte) error

func (DisruptionSpec) Validate

func (s DisruptionSpec) Validate() (retErr error)

Validate applies rules for disruption global scope and all subsequent disruption specifications

type DisruptionStatus

type DisruptionStatus struct {
	IsStuckOnRemoval bool `json:"isStuckOnRemoval,omitempty"`
	IsInjected       bool `json:"isInjected,omitempty"`
	// +kubebuilder:validation:Enum=NotInjected;PartiallyInjected;PausedPartiallyInjected;Injected;PausedInjected;PreviouslyNotInjected;PreviouslyPartiallyInjected;PreviouslyInjected
	// +ddmark:validation:Enum=NotInjected;PartiallyInjected;PausedPartiallyInjected;Injected;PausedInjected;PreviouslyNotInjected;PreviouslyPartiallyInjected;PreviouslyInjected
	// +kubebuilder:default=NotInjected
	InjectionStatus chaostypes.DisruptionInjectionStatus `json:"injectionStatus,omitempty"`
	// +nullable
	TargetInjections TargetInjections `json:"targetInjections,omitempty"`
	// Actual targets selected by the disruption
	SelectedTargetsCount int `json:"selectedTargetsCount"`
	// Targets ignored by the disruption, (not in a ready state, already targeted, not in the count percentage...)
	IgnoredTargetsCount int `json:"ignoredTargetsCount"`
	// Number of targets with a chaos pod ready
	InjectedTargetsCount int `json:"injectedTargetsCount"`
	// Number of targets we want to target (count)
	DesiredTargetsCount int `json:"desiredTargetsCount"`
}

DisruptionStatus defines the observed state of Disruption

func (*DisruptionStatus) AddTargets

func (status *DisruptionStatus) AddTargets(newTargetsCount int, eligibleTargets TargetInjections)

AddTargets adds newTargetsCount random targets from the eligibleTargets list to the Target List - eligibleTargets should be previously filtered to not include current targets

func (*DisruptionStatus) DeepCopy

func (in *DisruptionStatus) DeepCopy() *DisruptionStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionStatus.

func (*DisruptionStatus) DeepCopyInto

func (in *DisruptionStatus) DeepCopyInto(out *DisruptionStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*DisruptionStatus) HasTarget

func (status *DisruptionStatus) HasTarget(searchTarget string) bool

HasTarget returns true when a target exists in the Target List or returns false.

func (*DisruptionStatus) RemoveDeadTargets

func (status *DisruptionStatus) RemoveDeadTargets(matchingTargets []string)

RemoveDeadTargets removes targets not found in matchingTargets from the targets list

func (*DisruptionStatus) RemoveTargets

func (status *DisruptionStatus) RemoveTargets(toRemoveTargetsCount int)

RemoveTargets removes toRemoveTargetsCount random targets from the Target List

type DisruptionTrigger

type DisruptionTrigger struct {
	// inject.notBefore: Normal reconciliation and chaos pod creation will occur, but chaos pods will wait to inject until NotInjectedBefore. Must be after NoPodsBefore if both are specified
	// createPods.notBefore: Will skip reconciliation until this time, no chaos pods will be created until after NoPodsBefore
	// +nullable
	NotBefore metav1.Time `json:"notBefore,omitempty"`
	// inject.offset: Identical to NotBefore, but specified as an offset from max(CreationTimestamp, NoPodsBefore) instead of as a metav1.Time
	// pods.offset: Identical to NotBefore, but specified as an offset from CreationTimestamp instead of as a metav1.Time
	// +nullable
	Offset DisruptionDuration `json:"offset,omitempty"`
}

+ddmark:validation:ExclusiveFields={NotBefore,Offset}

func (*DisruptionTrigger) DeepCopy

func (in *DisruptionTrigger) DeepCopy() *DisruptionTrigger

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionTrigger.

func (*DisruptionTrigger) DeepCopyInto

func (in *DisruptionTrigger) DeepCopyInto(out *DisruptionTrigger)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (DisruptionTrigger) IsZero

func (dt DisruptionTrigger) IsZero() bool

type DisruptionTriggers

type DisruptionTriggers struct {
	Inject     DisruptionTrigger `json:"inject,omitempty"`
	CreatePods DisruptionTrigger `json:"createPods,omitempty"`
}

DisruptionTriggers holds the options for changing when injector pods are created, and the timing of when the injection occurs

func (*DisruptionTriggers) DeepCopy

func (in *DisruptionTriggers) DeepCopy() *DisruptionTriggers

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DisruptionTriggers.

func (*DisruptionTriggers) DeepCopyInto

func (in *DisruptionTriggers) DeepCopyInto(out *DisruptionTriggers)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (DisruptionTriggers) IsZero

func (dt DisruptionTriggers) IsZero() bool

type EndpointAlteration

type EndpointAlteration struct {
	TargetEndpoint string `json:"endpoint"`
	// +kubebuilder:validation:Enum=OK;CANCELED;UNKNOWN;INVALID_ARGUMENT;DEADLINE_EXCEEDED;NOT_FOUND;ALREADY_EXISTS;PERMISSION_DENIED;RESOURCE_EXHAUSTED;FAILED_PRECONDITION;ABORTED;OUT_OF_RANGE;UNIMPLEMENTED;INTERNAL;UNAVAILABLE;DATA_LOSS;UNAUTHENTICATED
	// +ddmark:validation:Enum=OK;CANCELED;UNKNOWN;INVALID_ARGUMENT;DEADLINE_EXCEEDED;NOT_FOUND;ALREADY_EXISTS;PERMISSION_DENIED;RESOURCE_EXHAUSTED;FAILED_PRECONDITION;ABORTED;OUT_OF_RANGE;UNIMPLEMENTED;INTERNAL;UNAVAILABLE;DATA_LOSS;UNAUTHENTICATED
	ErrorToReturn string `json:"error,omitempty"`
	// +kubebuilder:validation:Enum={}
	// +ddmark:validation:Enum="{}"
	OverrideToReturn string `json:"override,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=100
	QueryPercent int `json:"queryPercent,omitempty"`
}

EndpointAlteration represents an endpoint to disrupt and the corresponding error to return +ddmark:validation:ExclusiveFields={ErrorToReturn,OverrideToReturn}

func (*EndpointAlteration) DeepCopy

func (in *EndpointAlteration) DeepCopy() *EndpointAlteration

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new EndpointAlteration.

func (*EndpointAlteration) DeepCopyInto

func (in *EndpointAlteration) DeepCopyInto(out *EndpointAlteration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type GRPCDisruptionSpec

type GRPCDisruptionSpec struct {
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:validation:Maximum=65535
	// +ddmark:validation:Minimum=1
	// +ddmark:validation:Maximum=65535
	Port      int                  `json:"port"`
	Endpoints []EndpointAlteration `json:"endpoints"`
}

GRPCDisruptionSpec represents a gRPC disruption

func (*GRPCDisruptionSpec) DeepCopy

func (in *GRPCDisruptionSpec) DeepCopy() *GRPCDisruptionSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GRPCDisruptionSpec.

func (*GRPCDisruptionSpec) DeepCopyInto

func (in *GRPCDisruptionSpec) DeepCopyInto(out *GRPCDisruptionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (GRPCDisruptionSpec) GenerateArgs

func (s GRPCDisruptionSpec) GenerateArgs() []string

GenerateArgs generates injection pod arguments for the given spec

func (GRPCDisruptionSpec) Validate

func (s GRPCDisruptionSpec) Validate() (retErr error)

Validate validates that all alterations have either an error or override to return and at least 1% chance of occurring, as well as that the sum of query percentages of all alterations assigned to a target endpoint do not exceed 100%

type HTTPMethods

type HTTPMethods []string

func (HTTPMethods) DeepCopy

func (in HTTPMethods) DeepCopy() HTTPMethods

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPMethods.

func (HTTPMethods) DeepCopyInto

func (in HTTPMethods) DeepCopyInto(out *HTTPMethods)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HTTPPath

type HTTPPath string

type HTTPPaths

type HTTPPaths []HTTPPath

func (HTTPPaths) DeepCopy

func (in HTTPPaths) DeepCopy() HTTPPaths

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPPaths.

func (HTTPPaths) DeepCopyInto

func (in HTTPPaths) DeepCopyInto(out *HTTPPaths)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HostRecordPair

type HostRecordPair struct {
	Hostname string    `json:"hostname"`
	Record   DNSRecord `json:"record"`
}

HostRecordPair represents a hostname and a corresponding dns record override

func (*HostRecordPair) DeepCopy

func (in *HostRecordPair) DeepCopy() *HostRecordPair

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HostRecordPair.

func (*HostRecordPair) DeepCopyInto

func (in *HostRecordPair) DeepCopyInto(out *HostRecordPair)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkDisruptionCloudServiceSpec

type NetworkDisruptionCloudServiceSpec struct {
	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	ServiceName string `json:"service"`
	// +kubebuilder:validation:Enum=tcp;udp;""
	// +ddmark:validation:Enum=tcp;udp;""
	Protocol string `json:"protocol,omitempty"`
	// +kubebuilder:validation:Enum=ingress;egress;""
	// +ddmark:validation:Enum=ingress;egress;""
	Flow string `json:"flow,omitempty"`
	// +kubebuilder:validation:Enum=new;est;""
	// +ddmark:validation:Enum=new;est;""
	ConnState string `json:"connState,omitempty"`
}

func (*NetworkDisruptionCloudServiceSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionCloudServiceSpec.

func (*NetworkDisruptionCloudServiceSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkDisruptionCloudSpec

type NetworkDisruptionCloudSpec struct {
	AWSServiceList     *[]NetworkDisruptionCloudServiceSpec `json:"aws,omitempty"`
	GCPServiceList     *[]NetworkDisruptionCloudServiceSpec `json:"gcp,omitempty"`
	DatadogServiceList *[]NetworkDisruptionCloudServiceSpec `json:"datadog,omitempty"`
}

+ddmark:validation:AtLeastOneOf={AWSServiceList,GCPServiceList,DatadogServiceList}

func (*NetworkDisruptionCloudSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionCloudSpec.

func (*NetworkDisruptionCloudSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NetworkDisruptionCloudSpec) TransformToCloudMap

TransformToCloudMap for ease of computing when transforming the cloud services ip ranges to a list of hosts to disrupt

type NetworkDisruptionHostSpec

type NetworkDisruptionHostSpec struct {
	Host string `json:"host,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=65535
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=65535
	Port int `json:"port,omitempty"`
	// +kubebuilder:validation:Enum=tcp;udp;""
	// +ddmark:validation:Enum=tcp;udp;""
	Protocol string `json:"protocol,omitempty"`
	// +kubebuilder:validation:Enum=ingress;egress;""
	// +ddmark:validation:Enum=ingress;egress;""
	Flow string `json:"flow,omitempty"`
	// +kubebuilder:validation:Enum=new;est;""
	// +ddmark:validation:Enum=new;est;""
	ConnState string `json:"connState,omitempty"`
}

func NetworkDisruptionHostSpecFromString

func NetworkDisruptionHostSpecFromString(hosts []string) ([]NetworkDisruptionHostSpec, error)

NetworkDisruptionHostSpecFromString parses the given hosts to host specs The expected format for hosts is <host>;<port>;<protocol>;<flow>;<connState>

func (*NetworkDisruptionHostSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionHostSpec.

func (*NetworkDisruptionHostSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (NetworkDisruptionHostSpec) Validate

func (h NetworkDisruptionHostSpec) Validate() error

type NetworkDisruptionServicePortSpec

type NetworkDisruptionServicePortSpec struct {
	Name string `json:"name,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=65535
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=65535
	Port int `json:"port,omitempty"`
}

func (*NetworkDisruptionServicePortSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionServicePortSpec.

func (*NetworkDisruptionServicePortSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NetworkDisruptionServiceSpec

type NetworkDisruptionServiceSpec struct {
	Name      string `json:"name"`
	Namespace string `json:"namespace"`
	// +optional
	Ports []NetworkDisruptionServicePortSpec `json:"ports,omitempty"`
}

func NetworkDisruptionServiceSpecFromString

func NetworkDisruptionServiceSpecFromString(services []string) ([]NetworkDisruptionServiceSpec, error)

NetworkDisruptionServiceSpecFromString parses the given services to service specs The expected format for services is <serviceName>;<serviceNamespace>

func (*NetworkDisruptionServiceSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionServiceSpec.

func (*NetworkDisruptionServiceSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (NetworkDisruptionServiceSpec) ExtractAffectedPortsInServicePorts

func (s NetworkDisruptionServiceSpec) ExtractAffectedPortsInServicePorts(k8sService *v1.Service) ([]v1.ServicePort, []NetworkDisruptionServicePortSpec)

type NetworkDisruptionSpec

type NetworkDisruptionSpec struct {
	// +nullable
	Hosts []NetworkDisruptionHostSpec `json:"hosts,omitempty"`
	// +nullable
	AllowedHosts               []NetworkDisruptionHostSpec `json:"allowedHosts,omitempty"`
	DisableDefaultAllowedHosts bool                        `json:"disableDefaultAllowedHosts,omitempty"`
	// +nullable
	Services []NetworkDisruptionServiceSpec `json:"services,omitempty"`
	// +nullable
	Cloud *NetworkDisruptionCloudSpec `json:"cloud,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=100
	Drop int `json:"drop,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=100
	Duplicate int `json:"duplicate,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=100
	Corrupt int `json:"corrupt,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=60000
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=60000
	Delay uint `json:"delay,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=100
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=100
	DelayJitter uint `json:"delayJitter,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +ddmark:validation:Minimum=0
	BandwidthLimit int `json:"bandwidthLimit,omitempty"`
	// +kubebuilder:validation:Minimum=0
	// +kubebuilder:validation:Maximum=65535
	// +ddmark:validation:Minimum=0
	// +ddmark:validation:Maximum=65535
	// +nullable
	DeprecatedPort *int `json:"port,omitempty"`
	// +kubebuilder:validation:Enum=egress;ingress
	// +ddmark:validation:Enum=egress;ingress
	DeprecatedFlow string `json:"flow,omitempty"`
	// +nullable
	HTTP *NetworkHTTPFilters `json:"http,omitempty"`
}

NetworkDisruptionSpec represents a network disruption injection +ddmark:validation:AtLeastOneOf={BandwidthLimit,Drop,Delay,Corrupt,Duplicate}

func (*NetworkDisruptionSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionSpec.

func (*NetworkDisruptionSpec) DeepCopyInto

func (in *NetworkDisruptionSpec) DeepCopyInto(out *NetworkDisruptionSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NetworkDisruptionSpec) Format

func (s *NetworkDisruptionSpec) Format() string

Format describe a NetworkDisruptionSpec

func (*NetworkDisruptionSpec) GenerateArgs

func (s *NetworkDisruptionSpec) GenerateArgs() []string

GenerateArgs generates injection or cleanup pod arguments for the given spec

func (*NetworkDisruptionSpec) HasHTTPFilters

func (s *NetworkDisruptionSpec) HasHTTPFilters() bool

HasHTTPFilters return true if a custom method or path is defined, else return false

func (*NetworkDisruptionSpec) UpdateHostsOnCloudDisruption

func (s *NetworkDisruptionSpec) UpdateHostsOnCloudDisruption(cloudManager cloudservice.CloudServicesProvidersManager) error

UpdateHostsOnCloudDisruption from a cloud spec disruption, get all ip ranges of services provided and appends them into the s.Hosts slice

func (*NetworkDisruptionSpec) Validate

func (s *NetworkDisruptionSpec) Validate() (retErr error)

Validate validates args for the given disruption

type NetworkHTTPFilters

type NetworkHTTPFilters struct {
	DeprecatedMethod string      `json:"method,omitempty"`
	DeprecatedPath   HTTPPath    `json:"path,omitempty"`
	Methods          HTTPMethods `json:"methods,omitempty"`
	Paths            HTTPPaths   `json:"paths,omitempty"`
}

NetworkHTTPFilters contains http filters

func (*NetworkHTTPFilters) DeepCopy

func (in *NetworkHTTPFilters) DeepCopy() *NetworkHTTPFilters

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkHTTPFilters.

func (*NetworkHTTPFilters) DeepCopyInto

func (in *NetworkHTTPFilters) DeepCopyInto(out *NetworkHTTPFilters)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type NodeFailureSpec

type NodeFailureSpec struct {
	Shutdown bool `json:"shutdown,omitempty"`
}

NodeFailureSpec represents a node failure injection

func (*NodeFailureSpec) DeepCopy

func (in *NodeFailureSpec) DeepCopy() *NodeFailureSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NodeFailureSpec.

func (*NodeFailureSpec) DeepCopyInto

func (in *NodeFailureSpec) DeepCopyInto(out *NodeFailureSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*NodeFailureSpec) GenerateArgs

func (s *NodeFailureSpec) GenerateArgs() []string

GenerateArgs generates injection or cleanup pod arguments for the given spec

func (*NodeFailureSpec) Validate

func (s *NodeFailureSpec) Validate() error

Validate validates args for the given disruption

type OpenatSyscallSpec

type OpenatSyscallSpec struct {
	// Refer to this documentation: https://linux.die.net/man/2/open
	// +kubebuilder:validation:Enum=EACCES;EDQUOT;EEXIST;EFAULT;EFBIG;EINTR;EISDIR;ELOOP;EMFILE;ENAMETOOLONG;ENFILE;ENODEV;ENOENT;ENOMEM;ENOSPC;ENOTDIR;ENXIO;EOVERFLOW;EPERM;EROFS;ETXTBSY;EWOULDBLOCK
	// +ddmark:validation:Enum=EACCES;EDQUOT;EEXIST;EFAULT;EFBIG;EINTR;EISDIR;ELOOP;EMFILE;ENAMETOOLONG;ENFILE;ENODEV;ENOENT;ENOMEM;ENOSPC;ENOTDIR;ENXIO;EOVERFLOW;EPERM;EROFS;ETXTBSY;EWOULDBLOCK
	ExitCode string `json:"exitCode"`
}

OpenatSyscallSpec syscall specs

func (*OpenatSyscallSpec) DeepCopy

func (in *OpenatSyscallSpec) DeepCopy() *OpenatSyscallSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new OpenatSyscallSpec.

func (*OpenatSyscallSpec) DeepCopyInto

func (in *OpenatSyscallSpec) DeepCopyInto(out *OpenatSyscallSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*OpenatSyscallSpec) GetExitCodeInt

func (oss *OpenatSyscallSpec) GetExitCodeInt() int

GetExitCodeInt return the integer value of a linux exit code.

type Reporting

type Reporting struct {
	// SlackChannel is the destination slack channel to send reporting informations to.
	// It's expected to follow slack naming conventions https://api.slack.com/methods/conversations.create#naming or slack channel ID format
	// +kubebuilder:validation:MaxLength=80
	// +kubebuilder:validation:Pattern=(^[a-z0-9-_]+$)|(^C[A-Z0-9]+$)
	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	SlackChannel string `json:"slackChannel,omitempty"`
	// Purpose determines contextual informations about the disruption
	// a brief context to determines disruption goal
	// +kubebuilder:validation:MinLength=10
	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	Purpose string `json:"purpose,omitempty"`
	// MinNotificationType is the minimal notification type we want to receive informations for
	// In order of importance it's Info, Success, Warning, Error
	// Default level is considered Success, meaning all info will be ignored
	MinNotificationType eventtypes.NotificationType `json:"minNotificationType,omitempty"`
}

Reporting provides additional reporting options in order to send a message to a custom slack channel it expects the main controller to have the slack notifier enabled it expects a slack bot to be added to the defined slack channel

func (*Reporting) DeepCopy

func (in *Reporting) DeepCopy() *Reporting

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reporting.

func (*Reporting) DeepCopyInto

func (in *Reporting) DeepCopyInto(out *Reporting)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TargetInjection

type TargetInjection struct {
	InjectorPodName string `json:"injectorPodName,omitempty"`
	// +kubebuilder:validation:Enum=NotInjected;Injected;IsStuckOnRemoval
	// +ddmark:validation:Enum=NotInjected;Injected;IsStuckOnRemoval
	InjectionStatus chaostypes.DisruptionTargetInjectionStatus `json:"injectionStatus,omitempty"`
	// since when this status is in place
	Since metav1.Time `json:"since,omitempty"`
}

func (*TargetInjection) DeepCopy

func (in *TargetInjection) DeepCopy() *TargetInjection

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetInjection.

func (*TargetInjection) DeepCopyInto

func (in *TargetInjection) DeepCopyInto(out *TargetInjection)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TargetInjections

type TargetInjections map[string]TargetInjectorMap

TargetInjections is a map of target names to injectors

func (TargetInjections) DeepCopy

func (in TargetInjections) DeepCopy() TargetInjections

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetInjections.

func (TargetInjections) DeepCopyInto

func (in TargetInjections) DeepCopyInto(out *TargetInjections)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (TargetInjections) GetTargetNames

func (in TargetInjections) GetTargetNames() []string

GetTargetNames return the name of targets

func (TargetInjections) NotFullyInjected

func (in TargetInjections) NotFullyInjected() bool

NotFullyInjected checks if any of the TargetInjections in the list are not fully injected.

Returns:

  • bool: true if any TargetInjection is not fully injected, false if all are fully injected or the list is empty.

type TargetInjectorMap

type TargetInjectorMap map[chaostypes.DisruptionKindName]TargetInjection

func (TargetInjectorMap) DeepCopy

func (in TargetInjectorMap) DeepCopy() TargetInjectorMap

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetInjectorMap.

func (TargetInjectorMap) DeepCopyInto

func (in TargetInjectorMap) DeepCopyInto(out *TargetInjectorMap)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (TargetInjectorMap) GetInjectionWithDisruptionKind

func (m TargetInjectorMap) GetInjectionWithDisruptionKind(kindName chaostypes.DisruptionKindName) *TargetInjection

GetInjectionWithDisruptionKind retrieves a TargetInjection associated with a specific DisruptionKindName from the map.

Parameters:

  • kindName: The DisruptionKindName to search for in the map.

Returns:

  • *TargetInjection: A pointer to the TargetInjection with the matching DisruptionKindName, or nil if not found.

type TargetResourceSpec

type TargetResourceSpec struct {
	// +kubebuilder:validation:Enum=deployment;statefulset
	// +kubebuilder:validation:Required
	// +ddmark:validation:Enum=deployment;statefulset
	// +ddmark:validation:Required=true
	// Kind specifies the type of the long-lived resource. Allowed values: "deployment", "statefulset".
	Kind string `json:"kind"`

	// +kubebuilder:validation:Required
	// +ddmark:validation:Required=true
	// Name specifies the name of the specific instance of the long-lived resource to be targeted.
	Name string `json:"name"`
}

TargetResource specifies the long-lived resource to be targeted for disruptions. DisruptionCrons are intended to exist semi-permanently, and thus appropriate targets can only be other long-lived resources, such as statefulsets or deployment.

func (*TargetResourceSpec) DeepCopy

func (in *TargetResourceSpec) DeepCopy() *TargetResourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetResourceSpec.

func (*TargetResourceSpec) DeepCopyInto

func (in *TargetResourceSpec) DeepCopyInto(out *TargetResourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type TerminationStatus

type TerminationStatus uint8
const (
	TSNotTerminated TerminationStatus = iota
	TSTemporarilyTerminated
	TSDefinitivelyTerminated
)

type UnsafemodeSpec

type UnsafemodeSpec struct {
	DisableAll                 bool    `json:"disableAll,omitempty"`
	DisableCountTooLarge       bool    `json:"disableCountTooLarge,omitempty"`
	DisableNeitherHostNorPort  bool    `json:"disableNeitherHostNorPort,omitempty"`
	DisableSpecificContainDisk bool    `json:"disableSpecificContainDisk,omitempty"`
	AllowRootDiskFailure       bool    `json:"allowRootDiskFailure,omitempty"`
	Config                     *Config `json:"config,omitempty"`
}

UnsafemodeSpec represents a spec with parameters to turn off specific safety nets designed to catch common traps or issues running a disruption All of these are turned off by default, so disabling safety nets requires manually changing these booleans to true

func (*UnsafemodeSpec) DeepCopy

func (in *UnsafemodeSpec) DeepCopy() *UnsafemodeSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UnsafemodeSpec.

func (*UnsafemodeSpec) DeepCopyInto

func (in *UnsafemodeSpec) DeepCopyInto(out *UnsafemodeSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

Directories

Path Synopsis
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL