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 2025 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 2025 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 2025 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
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 2025 Datadog, Inc.
Index ¶
- Constants
- Variables
- func AdvancedSelectorsToRequirements(advancedSelectors []metav1.LabelSelectorRequirement) ([]labels.Requirement, error)
- func DisruptionHasNoSideEffects(kind string) bool
- func DisruptionIsNotReinjectable(kind chaostypes.DisruptionKindName) bool
- func GetChaosPods(ctx context.Context, log *zap.SugaredLogger, chaosNamespace string, ...) ([]corev1.Pod, error)
- func GetIntOrPercentValueSafely(intOrStr *intstr.IntOrString) (int, bool, error)
- func IsDisruptionCompletionEvent(event corev1.Event) bool
- func IsNotifiableEvent(event corev1.Event) bool
- func IsRecoveryEvent(event corev1.Event) bool
- func IsTargetEvent(event corev1.Event) bool
- func IsUpdateConflictError(err error) bool
- func ShouldSkipNodeFailureInjection(disKind chaostypes.DisruptionKindName, instance *Disruption, ...) bool
- func TargetedContainers(pod corev1.Pod, containerNames []string) (map[string]string, error)
- func ValidateCount(count *intstr.IntOrString) error
- type CPUPressureSpec
- type Config
- type ContainerFailureSpec
- type CountTooLargeConfig
- type DNSDisruptionSpec
- type DNSRecord
- type DiskFailureSpec
- type DiskPressureSpec
- type DiskPressureThrottlingSpec
- type Disruption
- func (r *Disruption) CopyOwnerAnnotations(owner metav1.Object)
- func (r *Disruption) CopyUserInfoToAnnotations(owner metav1.Object) error
- func (in *Disruption) DeepCopy() *Disruption
- func (in *Disruption) DeepCopyInto(out *Disruption)
- func (in *Disruption) DeepCopyObject() runtime.Object
- func (r *Disruption) Default()
- func (r *Disruption) GetScheduledAtAnnotation() (time.Time, error)
- func (r *Disruption) GetTargetsCountAsInt(targetTotal int, roundUp bool) (int, error)
- func (r *Disruption) IsDeletionExpired(deletionTimeout time.Duration) bool
- func (r *Disruption) IsReadyToRemoveFinalizer(finalizerDelay time.Duration) bool
- func (r *Disruption) RemainingDuration() time.Duration
- func (r *Disruption) SetScheduledAtAnnotation(scheduledTime time.Time)
- func (r *Disruption) SetSpanContext(ctx context.Context) error
- func (r *Disruption) SetUserInfo(userInfo authV1.UserInfo) error
- func (r *Disruption) SetupWebhookWithManager(setupWebhookConfig utils.SetupWebhookWithManagerConfig) error
- func (r *Disruption) SpanContext(ctx context.Context) (context.Context, error)
- func (r *Disruption) TerminationStatus(chaosPods []corev1.Pod) TerminationStatus
- func (r *Disruption) TimeToCreatePods() time.Time
- func (r *Disruption) TimeToInject() time.Time
- func (r *Disruption) UserInfo() (authV1.UserInfo, error)
- func (r *Disruption) ValidateCreate() (_ admission.Warnings, err error)
- func (r *Disruption) ValidateDelete() (admission.Warnings, error)
- func (r *Disruption) ValidateUpdate(old runtime.Object) (_ admission.Warnings, err error)
- type DisruptionCron
- func (in *DisruptionCron) DeepCopy() *DisruptionCron
- func (in *DisruptionCron) DeepCopyInto(out *DisruptionCron)
- func (in *DisruptionCron) DeepCopyObject() runtime.Object
- func (d *DisruptionCron) Default()
- func (d *DisruptionCron) IsReadyToRemoveFinalizer(finalizerDelay time.Duration) bool
- func (d *DisruptionCron) SetUserInfo(userInfo authV1.UserInfo) error
- func (d *DisruptionCron) SetupWebhookWithManager(setupWebhookConfig utils.SetupWebhookWithManagerConfig) error
- func (d *DisruptionCron) UserInfo() (authV1.UserInfo, error)
- func (d *DisruptionCron) ValidateCreate() (_ admission.Warnings, err error)
- func (d *DisruptionCron) ValidateDelete() (warnings admission.Warnings, err error)
- func (d *DisruptionCron) ValidateUpdate(oldObject runtime.Object) (_ admission.Warnings, err error)
- type DisruptionCronList
- type DisruptionCronSpec
- type DisruptionCronStatus
- type DisruptionCronTrigger
- type DisruptionDuration
- type DisruptionFilter
- type DisruptionList
- type DisruptionPulse
- type DisruptionRollout
- type DisruptionRolloutList
- type DisruptionRolloutSpec
- type DisruptionRolloutStatus
- type DisruptionSpec
- func (in *DisruptionSpec) DeepCopy() *DisruptionSpec
- func (in *DisruptionSpec) DeepCopyInto(out *DisruptionSpec)
- func (s DisruptionSpec) DisruptionCount() int
- func (s DisruptionSpec) DisruptionKindPicker(kind chaostypes.DisruptionKindName) chaosapi.DisruptionKind
- func (s DisruptionSpec) Hash() (string, error)
- func (s DisruptionSpec) HashNoCount() (string, error)
- func (s DisruptionSpec) KindNames() []chaostypes.DisruptionKindName
- func (s *DisruptionSpec) SetDefaults()
- func (s *DisruptionSpec) UnmarshalJSON(data []byte) error
- func (s DisruptionSpec) Validate() (retErr error)
- func (s DisruptionSpec) ValidateSelectorsOptional(requireSelectors bool) (retErr error)
- type DisruptionStatus
- func (status *DisruptionStatus) AddTargets(newTargetsCount int, eligibleTargets TargetInjections)
- func (in *DisruptionStatus) DeepCopy() *DisruptionStatus
- func (in *DisruptionStatus) DeepCopyInto(out *DisruptionStatus)
- func (status *DisruptionStatus) HasTarget(searchTarget string) bool
- func (status *DisruptionStatus) RemoveDeadTargets(matchingTargets []string)
- func (status *DisruptionStatus) RemoveTargets(toRemoveTargetsCount int)
- type DisruptionTrigger
- type DisruptionTriggers
- type EndpointAlteration
- type Event
- type EventCategory
- type EventReason
- type GRPCDisruptionSpec
- type HTTPMethods
- type HTTPPath
- type HTTPPaths
- type HostRecordPair
- type NetworkDisruptionCloudServiceSpec
- type NetworkDisruptionCloudSpec
- func (in *NetworkDisruptionCloudSpec) DeepCopy() *NetworkDisruptionCloudSpec
- func (in *NetworkDisruptionCloudSpec) DeepCopyInto(out *NetworkDisruptionCloudSpec)
- func (s *NetworkDisruptionCloudSpec) TransformToCloudMap() map[string][]NetworkDisruptionCloudServiceSpec
- func (s *NetworkDisruptionCloudSpec) Validate() error
- type NetworkDisruptionHostSpec
- type NetworkDisruptionServicePortSpec
- type NetworkDisruptionServiceSpec
- func (in *NetworkDisruptionServiceSpec) DeepCopy() *NetworkDisruptionServiceSpec
- func (in *NetworkDisruptionServiceSpec) DeepCopyInto(out *NetworkDisruptionServiceSpec)
- func (s NetworkDisruptionServiceSpec) ExtractAffectedPortsInServicePorts(k8sService *v1.Service) ([]v1.ServicePort, []NetworkDisruptionServicePortSpec)
- type NetworkDisruptionSpec
- func (in *NetworkDisruptionSpec) DeepCopy() *NetworkDisruptionSpec
- func (in *NetworkDisruptionSpec) DeepCopyInto(out *NetworkDisruptionSpec)
- func (s *NetworkDisruptionSpec) Format() string
- func (s *NetworkDisruptionSpec) GenerateArgs() []string
- func (s *NetworkDisruptionSpec) HasHTTPFilters() bool
- func (s *NetworkDisruptionSpec) UpdateHostsOnCloudDisruption(cloudManager cloudservice.CloudServicesProvidersManager) error
- func (s *NetworkDisruptionSpec) Validate() (retErr error)
- type NetworkHTTPFilters
- type NodeFailureSpec
- type OpenatSyscallSpec
- type Reporting
- type TargetInjection
- type TargetInjections
- type TargetInjectorMap
- type TargetResourceSpec
- type TerminationStatus
- type UnsafemodeSpec
Constants ¶
const ( EventDisruptionCronAnnotation = "disruption_cron" EventDisruptionAnnotation = "disruption" )
const ( EventOnTargetTemplate string = "Failing probably caused by disruption %s: " SourceDisruptionComponent string = "disruption-controller" SourceDisruptionCronComponent string = "disruptioncron-controller" )
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; " )
const APIVersion = "v1beta1"
APIVersion is exported for client-go purposes
const DisruptionCronKind = "DisruptionCron"
DisruptionCronKind is the disruption cron kind
const DisruptionKind = "Disruption"
DisruptionKind is the disruption kind
const ERROR = "error"
ERROR represents the type of gRPC alteration where a response is spoofed with a gRPC error code
const GroupName = chaostypes.GroupName
GroupName is exported for client-go purposes
const MaxClusterThreshold = float64(1)
MaxClusterThreshold is the float64 of 1.0, representing 100%. clusterThreshold is passed into the config as integer percentage values from 1-100, and then divided by 100.0 for working with in safetyNetCountNotTooLarge
const MaxDiskPathCharacters = 62
MaxDiskPathCharacters is used to limit the number of characters due to the eBPF memory kernel limitation.
const MaxHistoryLen = 5
const MaxNamespaceThreshold = float64(1)
MaxNamespaceThreshold is the float64 of 1.0, representing 100%. namespaceThreshold is passed into the config as integer percentage values from 1-100, and then divided by 100.0 for working with in safetyNetCountNotTooLarge
const OVERRIDE = "override"
OVERRIDE represents the type of gRPC alteration where a response is spoofed with a specified return value
const SafemodeEnvironmentAnnotation = GroupName + "/environment"
Variables ¶
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(), } )
var ( // ClientSchemeBuilder is exported for client-go purposes ClientSchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes) )
var EmbeddedChaosAPI embed.FS
EmbeddedChaosAPI includes the library so it can be statically exported to chaosli
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") )
var ( // ErrNoUserInfo is the error returned when the annotation does not contains expected user info key ErrNoUserInfo = fmt.Errorf("user info not found in annotations") )
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
var Events = map[EventReason]Event{ 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: DisruptionEvent, }, EventDisruptionGCOver: { Type: corev1.EventTypeNormal, Reason: EventDisruptionGCOver, OnDisruptionTemplateMessage: "The disruption has lived %s longer than its specified duration, and will now be deleted.", Category: DisruptionEvent, }, EventEmptyDisruption: { Type: corev1.EventTypeWarning, Reason: EventEmptyDisruption, OnDisruptionTemplateMessage: "No disruption recognized for \"%s\" therefore no disruption applied.", Category: DisruptionEvent, }, EventDisruptionCreationFailed: { Type: corev1.EventTypeWarning, Reason: EventDisruptionCreationFailed, OnDisruptionTemplateMessage: "Injection pod for disruption \"%s\" failed to be created", Category: DisruptionEvent, }, 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: DisruptionEvent, }, EventInvalidDisruptionLabelSelector: { Type: corev1.EventTypeWarning, Reason: EventInvalidDisruptionLabelSelector, OnDisruptionTemplateMessage: "%s. No targets will be selected.", Category: DisruptionEvent, }, 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: DisruptionEvent, }, 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: DisruptionEvent, }, EventInvalidSpecDisruption: { Type: corev1.EventTypeWarning, Reason: EventInvalidSpecDisruption, OnDisruptionTemplateMessage: "%s", Category: DisruptionEvent, }, EventDisruptionChaosPodCreated: { Type: corev1.EventTypeNormal, Reason: EventDisruptionChaosPodCreated, OnDisruptionTemplateMessage: "Created disruption injection pod for \"%s\"", Category: DisruptionEvent, }, EventDisruptionCreated: { Type: corev1.EventTypeNormal, Reason: EventDisruptionCreated, OnDisruptionTemplateMessage: "Disruption created", Category: DisruptionEvent, }, EventDisruptionCronCreated: { Type: corev1.EventTypeNormal, Reason: EventDisruptionCronCreated, OnDisruptionTemplateMessage: "DisruptionCron created", Category: DisruptionCronEvent, }, EventDisruptionCronUpdated: { Type: corev1.EventTypeNormal, Reason: EventDisruptionCronUpdated, OnDisruptionTemplateMessage: "DisruptionCron updated", Category: DisruptionCronEvent, }, EventDisruptionCronDeleted: { Type: corev1.EventTypeNormal, Reason: EventDisruptionCronDeleted, OnDisruptionTemplateMessage: "DisruptionCron deleted", Category: DisruptionCronEvent, }, EventDisruptionCleaned: { Type: corev1.EventTypeNormal, Reason: EventDisruptionCleaned, OnDisruptionTemplateMessage: "Disruption has been cleaned and should be deleted shortly after", Category: DisruptionEvent, }, EventDisruptionFinished: { Type: corev1.EventTypeNormal, Reason: EventDisruptionFinished, OnDisruptionTemplateMessage: "Disruption finished", Category: DisruptionEvent, }, EventDisrupted: { Type: corev1.EventTypeNormal, Reason: EventDisrupted, OnTargetTemplateMessage: "Pod %s from disruption %s targeted this resource for injection", Category: DisruptionEvent, }, 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, }, }
var NoSideEffectDisruptions = map[chaostypes.DisruptionKindName]struct{}{ chaostypes.DisruptionKindNodeFailure: {}, chaostypes.DisruptionKindContainerFailure: {}, }
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.
var NonReinjectableDisruptions = map[chaostypes.DisruptionKindName]struct{}{ chaostypes.DisruptionKindGRPCDisruption: {}, chaostypes.DisruptionKindNodeFailure: {}, }
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 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 IsNotifiableEvent ¶
IsNotifiableEvent this event can be broadcasted to our notifiers
func IsRecoveryEvent ¶
func IsTargetEvent ¶
func IsUpdateConflictError ¶
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 ¶
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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Config.
func (*Config) DeepCopyInto ¶
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 ¶
func (in *ContainerFailureSpec) DeepCopy() *ContainerFailureSpec
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 NamespaceThreshold *int `json:"namespaceThreshold,omitempty"` // +kubebuilder:validation:Minimum=1 // +kubebuilder:validation:Maximum=100 ClusterThreshold *int `json:"clusterThreshold,omitempty"` }
CountTooLargeConfig represents the configuration for the countTooLarge safetynet
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 ¶
DNSRecord represents a type of DNS Record, such as A or CNAME, and the value of that record
func (*DNSRecord) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DNSRecord.
func (*DNSRecord) DeepCopyInto ¶
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 Paths []string `json:"paths" chaos_validate:"required"` // +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 { // +kubebuilder:validation:Required Path string `json:"path" chaos_validate:"required"` // +kubebuilder:validation:Required Throttling DiskPressureThrottlingSpec `json:"throttling" chaos_validate:"required"` }
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 ¶
func (in *DiskPressureThrottlingSpec) DeepCopy() *DiskPressureThrottlingSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DiskPressureThrottlingSpec.
func (*DiskPressureThrottlingSpec) DeepCopyInto ¶
func (in *DiskPressureThrottlingSpec) DeepCopyInto(out *DiskPressureThrottlingSpec)
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,update
func ReadUnmarshal ¶
func ReadUnmarshal(path string) (*Disruption, error)
func (*Disruption) CopyOwnerAnnotations ¶
func (r *Disruption) CopyOwnerAnnotations(owner metav1.Object)
CopyOwnerAnnotations copies the annotations from the owner object to the disruption. This ensures that any important metadata from the owner, such as custom annotations, is preserved in the newly created disruption.
func (*Disruption) CopyUserInfoToAnnotations ¶
func (r *Disruption) CopyUserInfoToAnnotations(owner metav1.Object) error
CopyUserInfoToAnnotations copies the user-related annotations from the owner object to the disruption. Any UserInfo annotations will be overwritten when the Disruption is created, so this function ensures that the parent resource's user information is preserved by storing it in separate annotations.
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) GetScheduledAtAnnotation ¶
func (r *Disruption) GetScheduledAtAnnotation() (time.Time, error)
GetScheduledAtAnnotation retrieves the scheduled time from the disruption's annotations. Returns an error if the annotation is not found or cannot be parsed.
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) IsReadyToRemoveFinalizer ¶
func (r *Disruption) IsReadyToRemoveFinalizer(finalizerDelay time.Duration) bool
IsReadyToRemoveFinalizer checks if a disruption has been cleaned and has waited for finalizerDelay duration before removing finalizer
func (*Disruption) RemainingDuration ¶
func (r *Disruption) RemainingDuration() time.Duration
RemainingDuration return the remaining duration of the disruption.
func (*Disruption) SetScheduledAtAnnotation ¶
func (r *Disruption) SetScheduledAtAnnotation(scheduledTime time.Time)
SetScheduledAtAnnotation sets the scheduled time of the disruption in the annotations.
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 authV1.UserInfo) error
SetUserInfo store provided userInfo into expected disruption annotation
func (*Disruption) SetupWebhookWithManager ¶
func (r *Disruption) SetupWebhookWithManager(setupWebhookConfig utils.SetupWebhookWithManagerConfig) error
func (*Disruption) SpanContext ¶
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() (authV1.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, err 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 ¶
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,update
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.
func (*DisruptionCron) Default ¶
func (d *DisruptionCron) Default()
Default implements webhook.Defaulter so a webhook will be registered for the type
func (*DisruptionCron) IsReadyToRemoveFinalizer ¶
func (d *DisruptionCron) IsReadyToRemoveFinalizer(finalizerDelay time.Duration) bool
IsReadyToRemoveFinalizer checks if adisruptioncron has been deleting for > finalizerDelay
func (*DisruptionCron) SetUserInfo ¶
func (d *DisruptionCron) SetUserInfo(userInfo authV1.UserInfo) error
SetUserInfo store provided userInfo into expected disruption annotation
func (*DisruptionCron) SetupWebhookWithManager ¶
func (d *DisruptionCron) SetupWebhookWithManager(setupWebhookConfig utils.SetupWebhookWithManagerConfig) error
func (*DisruptionCron) UserInfo ¶
func (d *DisruptionCron) UserInfo() (authV1.UserInfo, error)
UserInfo returns extracted user info informations or an error if not available or invalid
func (*DisruptionCron) ValidateCreate ¶
func (d *DisruptionCron) ValidateCreate() (_ admission.Warnings, err error)
ValidateCreate implements webhook.Validator so a webhook will be registered for the type
func (*DisruptionCron) ValidateDelete ¶
func (d *DisruptionCron) ValidateDelete() (warnings admission.Warnings, err error)
func (*DisruptionCron) ValidateUpdate ¶
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 // The schedule in Cron format, see https://en.wikipedia.org/wiki/Cron. Schedule string `json:"schedule"` // If set to true, no disruptions will be created from this DisruptionCron // useful if there's a reason to temporarily stop injecting, but without // deleting this DisruptionCron Paused bool `json:"paused,omitempty"` // 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 // TargetResource specifies the resource to run disruptions against. // It can only be a deployment or statefulset. TargetResource TargetResourceSpec `json:"targetResource"` // +kubebuilder:validation:Required // Specifies the Disruption that will be created when executing a disruptioncron. DisruptionTemplate DisruptionSpec `json:"disruptionTemplate"` // +nullable Reporting *Reporting `json:"reporting,omitempty"` }
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 ¶
func (in *DisruptionCronStatus) DeepCopy() *DisruptionCronStatus
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 ¶
func (in *DisruptionCronTrigger) DeepCopy() *DisruptionCronTrigger
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 DisruptionFilter ¶
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
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 ¶
func (in *DisruptionRolloutList) DeepCopy() *DisruptionRolloutList
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 // TargetResource specifies the resource to run disruptions against. // It can only be a deployment or statefulset. TargetResource TargetResourceSpec `json:"targetResource"` // +kubebuilder:validation:Required // 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 ¶
func (in *DisruptionRolloutSpec) DeepCopy() *DisruptionRolloutSpec
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 ¶
func (in *DisruptionRolloutStatus) DeepCopy() *DisruptionRolloutStatus
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 Count *intstr.IntOrString `json:"count" chaos_validate:"required"` // 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 Level chaostypes.DisruptionLevel `json:"level,omitempty" chaos_validate:"omitempty,oneofci=pod node"` 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
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 ¶
func (s DisruptionSpec) DisruptionKindPicker(kind chaostypes.DisruptionKindName) chaosapi.DisruptionKind
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 ¶
func (s DisruptionSpec) KindNames() []chaostypes.DisruptionKindName
KindNames returns the non-nil disruption kind names for the given disruption
func (*DisruptionSpec) SetDefaults ¶
func (s *DisruptionSpec) SetDefaults()
SetDefaults finds any unset spec options, and sets the default values. Only operates on values that lack kubebuilder struct default tags, which typically only includes complex types, such as spec.duration
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, requiring selectors intended to be called when DisruptionSpec belongs directly to a Disruption also exists for backwards compatibility
func (DisruptionSpec) ValidateSelectorsOptional ¶
func (s DisruptionSpec) ValidateSelectorsOptional(requireSelectors bool) (retErr error)
ValidateSelectorsOptional 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 // +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"` // timestamp of when a disruption has been cleaned last. // +nullable CleanedAt *metav1.Time `json:"cleanedAt,omitempty"` }
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"` }
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 { // +kubebuilder:validation:Required TargetEndpoint string `json:"endpoint" chaos_validate:"required"` // +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 ErrorToReturn string `` /* 276-byte string literal not displayed */ // +kubebuilder:validation:Enum={} OverrideToReturn string `json:"override,omitempty"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 QueryPercent int `json:"queryPercent,omitempty" chaos_validate:"omitempty,gte=0,lte=100"` }
EndpointAlteration represents an endpoint to disrupt and the corresponding error to return
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 Event ¶
type Event struct { Type string // Warning or Normal Reason EventReason // 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 (DisruptionEvent 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 EventCategory // Either TargetEvent, Event or ChaosPodEvent }
func (*Event) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Event.
func (*Event) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type EventCategory ¶
type EventCategory string
const ( // TargetEvent only attached to a target TargetEvent EventCategory = "TargetEvent" // DisruptionEvent only attached to the disruption DisruptionEvent EventCategory = "DisruptionEvent" // DisruptionCronEvent only attached to the disruption cron DisruptionCronEvent EventCategory = "DisruptionCronEvent" // ChaosPodEvent only attached to a chaos pod ChaosPodEvent EventCategory = "ChaosPodEvent" )
type EventReason ¶
type EventReason string
EventReason is the string that identify an event
const ( // Targeted pods related // Warning events EventTargetPodWarningState EventReason = "TargetPodInWarningState" EventTargetContainerWarningState EventReason = "TargetPodContainersInWarningState" EventTargetLivenessProbeChange EventReason = "TargetPodLivenessProbe" EventTargetTooManyRestarts EventReason = "TargetPodTooManyRestarts" EventTargetReadinessProbeChangeBeforeDisruption EventReason = "TargetReadinessProbeChangeBeforeDisruption" // Normal events EventTargetPodRecoveredState EventReason = "RecoveredWarningStateInTargetPod" EventTargetReadinessProbeChangeDuringDisruption EventReason = "ReadinessProbeChangeDuringDisruption" // Targeted nodes related // Warning events EventTargetNodeMemPressureState EventReason = "TargetNodeUnderMemoryPressure" EventTargetNodeDiskPressureState EventReason = "TargetNodeUnderDiskPressure" EventTargetNodeWarningState EventReason = "TargetNodeInWarningState" // Normal events EventTargetNodeRecoveredState EventReason = "RecoveredWarningStateInTargetNode" // Disruption related events // Warning events EventEmptyDisruption EventReason = "EmptyDisruption" EventDisruptionCreationFailed EventReason = "CreateFailed" EventDisruptionStuckOnRemoval EventReason = "StuckOnRemoval" EventInvalidDisruptionLabelSelector EventReason = "InvalidLabelSelector" EventDisruptionNoMoreValidTargets EventReason = "NoMoreTargets" EventDisruptionNoTargetsFound EventReason = "NoTargetsFound" EventInvalidSpecDisruption EventReason = "InvalidSpec" // Normal events EventDisruptionChaosPodCreated EventReason = "ChaosPodCreated" EventDisruptionCleaned EventReason = "Cleaned" EventDisruptionFinished EventReason = "Finished" EventDisruptionCreated EventReason = "Created" EventDisruptionDurationOver EventReason = "DurationOver" EventDisruptionGCOver EventReason = "GCOver" EventDisrupted EventReason = "Disrupted" // DisruptionCron related events EventDisruptionCronCreated EventReason = "DisruptionCronCreated" EventDisruptionCronUpdated EventReason = "DisruptionCronUpdated" EventDisruptionCronDeleted EventReason = "DisruptionCronDeleted" // Injection related events // Warning events EventChaosPodFailedState EventReason = "ChaosPodWarningState" )
Complete list of events sent out by the controller
func GetEventReason ¶
func GetEventReason(event corev1.Event) EventReason
func (EventReason) MatchEventReason ¶
func (r EventReason) MatchEventReason(e corev1.Event) bool
MatchEventReason check if provided Kubernetes event match actual reason
type GRPCDisruptionSpec ¶
type GRPCDisruptionSpec struct { // +kubebuilder:validation:Minimum=1 // +kubebuilder:validation:Maximum=65535 Port int `json:"port" chaos_validate:"gte=1,lte=65535"` // +kubebuilder:validation:Required Endpoints []EndpointAlteration `json:"endpoints" chaos_validate:"required,dive"` }
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 HTTPPaths ¶
type HTTPPaths []HTTPPath
func (HTTPPaths) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HTTPPaths.
func (HTTPPaths) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HostRecordPair ¶
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 ServiceName string `json:"service" chaos_validate:"required"` // +kubebuilder:validation:Enum=tcp;udp;"" Protocol string `json:"protocol,omitempty" chaos_validate:"omitempty,oneofci=tcp udp"` // +kubebuilder:validation:Enum=ingress;egress;"" Flow string `json:"flow,omitempty" chaos_validate:"omitempty,oneofci=ingress egress"` // +kubebuilder:validation:Enum=new;est;"" ConnState string `json:"connState,omitempty" chaos_validate:"omitempty,oneofci=new est"` }
func (*NetworkDisruptionCloudServiceSpec) DeepCopy ¶
func (in *NetworkDisruptionCloudServiceSpec) DeepCopy() *NetworkDisruptionCloudServiceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionCloudServiceSpec.
func (*NetworkDisruptionCloudServiceSpec) DeepCopyInto ¶
func (in *NetworkDisruptionCloudServiceSpec) DeepCopyInto(out *NetworkDisruptionCloudServiceSpec)
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" chaos_validate:"omitempty,dive"` GCPServiceList *[]NetworkDisruptionCloudServiceSpec `json:"gcp,omitempty" chaos_validate:"omitempty,dive"` DatadogServiceList *[]NetworkDisruptionCloudServiceSpec `json:"datadog,omitempty" chaos_validate:"omitempty,dive"` }
func (*NetworkDisruptionCloudSpec) DeepCopy ¶
func (in *NetworkDisruptionCloudSpec) DeepCopy() *NetworkDisruptionCloudSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionCloudSpec.
func (*NetworkDisruptionCloudSpec) DeepCopyInto ¶
func (in *NetworkDisruptionCloudSpec) DeepCopyInto(out *NetworkDisruptionCloudSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*NetworkDisruptionCloudSpec) TransformToCloudMap ¶
func (s *NetworkDisruptionCloudSpec) TransformToCloudMap() map[string][]NetworkDisruptionCloudServiceSpec
TransformToCloudMap for ease of computing when transforming the cloud services ip ranges to a list of hosts to disrupt
func (*NetworkDisruptionCloudSpec) Validate ¶
func (s *NetworkDisruptionCloudSpec) Validate() error
type NetworkDisruptionHostSpec ¶
type NetworkDisruptionHostSpec struct { Host string `json:"host,omitempty"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=65535 Port int `json:"port,omitempty" chaos_validate:"omitempty,gte=0,lte=65535"` // +kubebuilder:validation:Enum=tcp;udp;"" Protocol string `json:"protocol,omitempty" chaos_validate:"omitempty,oneofci=udp tcp"` // +kubebuilder:validation:Enum=ingress;egress;"" Flow string `json:"flow,omitempty" chaos_validate:"omitempty,oneofci=ingress egress"` // +kubebuilder:validation:Enum=new;est;"" ConnState string `json:"connState,omitempty" chaos_validate:"omitempty,oneofci=new est"` }
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 ¶
func (in *NetworkDisruptionHostSpec) DeepCopy() *NetworkDisruptionHostSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionHostSpec.
func (*NetworkDisruptionHostSpec) DeepCopyInto ¶
func (in *NetworkDisruptionHostSpec) DeepCopyInto(out *NetworkDisruptionHostSpec)
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 Port int `json:"port,omitempty" chaos_validate:"omitempty,gte=0,lte=65535"` }
func (*NetworkDisruptionServicePortSpec) DeepCopy ¶
func (in *NetworkDisruptionServicePortSpec) DeepCopy() *NetworkDisruptionServicePortSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionServicePortSpec.
func (*NetworkDisruptionServicePortSpec) DeepCopyInto ¶
func (in *NetworkDisruptionServicePortSpec) DeepCopyInto(out *NetworkDisruptionServicePortSpec)
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" chaos_validate:"omitempty,dive"` }
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 ¶
func (in *NetworkDisruptionServiceSpec) DeepCopy() *NetworkDisruptionServiceSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new NetworkDisruptionServiceSpec.
func (*NetworkDisruptionServiceSpec) DeepCopyInto ¶
func (in *NetworkDisruptionServiceSpec) DeepCopyInto(out *NetworkDisruptionServiceSpec)
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" chaos_validate:"omitempty,dive"` // +nullable AllowedHosts []NetworkDisruptionHostSpec `json:"allowedHosts,omitempty" chaos_validate:"omitempty,dive"` DisableDefaultAllowedHosts bool `json:"disableDefaultAllowedHosts,omitempty"` // +nullable Services []NetworkDisruptionServiceSpec `json:"services,omitempty" chaos_validate:"omitempty,dive"` // +nullable Cloud *NetworkDisruptionCloudSpec `json:"cloud,omitempty"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 Drop int `json:"drop,omitempty" chaos_validate:"omitempty,gte=0,lte=100"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 Duplicate int `json:"duplicate,omitempty" chaos_validate:"omitempty,gte=0,lte=100"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 Corrupt int `json:"corrupt,omitempty" chaos_validate:"omitempty,gte=0,lte=100"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=60000 Delay uint `json:"delay,omitempty" chaos_validate:"omitempty,gte=0,lte=60000"` // +kubebuilder:validation:Minimum=0 // +kubebuilder:validation:Maximum=100 DelayJitter uint `json:"delayJitter,omitempty" chaos_validate:"omitempty,gte=0,lte=100"` // +kubebuilder:validation:Minimum=0 BandwidthLimit int `json:"bandwidthLimit,omitempty" chaos_validate:"omitempty,gte=0"` // +nullable HTTP *NetworkHTTPFilters `json:"http,omitempty"` }
NetworkDisruptionSpec represents a network disruption injection
func (*NetworkDisruptionSpec) DeepCopy ¶
func (in *NetworkDisruptionSpec) DeepCopy() *NetworkDisruptionSpec
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 { 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 ExitCode string `` /* 204-byte string literal not displayed */ }
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 SlackChannel string `json:"slackChannel,omitempty" chaos_validate:"required"` // Purpose determines contextual informations about the disruption // a brief context to determines disruption goal // +kubebuilder:validation:MinLength=10 // +kubebuilder:validation:Required 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 ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Reporting.
func (*Reporting) DeepCopyInto ¶
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 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 // Kind specifies the type of the long-lived resource. Allowed values: "deployment", "statefulset". Kind string `json:"kind"` // +kubebuilder:validation:Required // Name specifies the name of the specific instance of the long-lived resource to be targeted. Name string `json:"name"` }
TargetResourceSpec 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.
func (*UnsafemodeSpec) Validate ¶
func (u *UnsafemodeSpec) Validate() error
Source Files
¶
- container_failure.go
- cpu_pressure.go
- disk_failure.go
- disk_pressure.go
- disruption_cron_types.go
- disruption_cron_webhook.go
- disruption_pods.go
- disruption_rollout_types.go
- disruption_spancontext.go
- disruption_types.go
- disruption_webhook.go
- dns_disruption.go
- doc.go
- events.go
- groupversion_info.go
- grpc_disruption.go
- network_disruption.go
- node_failure.go
- register.go
- safemode.go
- userinfo.go
- validations.go
- zz_generated.deepcopy.go