chaos

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: Apache-2.0 Imports: 24 Imported by: 0

README

/* The dynamic package on the other hand, uses a simple type, unstructured.Unstructured, to represent all object values from the API server. Type Unstructured uses a collection of nested map[string]interface{} values to create an internal structure that closely resemble the REST payload from the server.

The dynamic package defers all data bindings until runtime. This means programs that use the dynamic client will not get any of the benefits of type validation until the program is running. This may be a problem for certain types of applications that require strong data type check and validation.

Being loosely coupled, however, means that programs that uses the dynamic package do not require recompilation when the client API changes. The client program has more flexibility in handling updates to the API surface without knowing ahead of time what those changes are.

// PartitionSpec separate the given Pod from the rest of the network. This chaos typeis retractable // (either manually or after a duration) and can be waited at both Running and Success Phase. // Running phase begins when the failure is injected. Success begins when the failure is retracted. // If anything goes wrong in between, the chaos goes into Failed phase. type PartitionSpec struct { Selector ServiceSelector json:"selector"

// +optional
Duration *metav1.Duration `json:"duration,omitempty"`

}

// KillSpec terminates the selected Pod. Because this failure is permanent, it can only be waited in the // Running Phase. It does not go through Success. type KillSpec struct { Selector ServiceSelector json:"selector,omitempty" } */

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AsKill

func AsKill(fault *Fault)

func AsPartition

func AsPartition(fault *Fault)

func NewController

func NewController(mgr ctrl.Manager, logger logr.Logger) error

Types

type Condition

type Condition struct {
	Type   ConditionType
	Status corev1.ConditionStatus
	Reason string
}

func (Condition) True

func (c Condition) True() bool

type ConditionType

type ConditionType string

ConditionType ...

const (
	// ConditionSelected indicates the chaos experiment had correctly selected the target pods
	// where to inject chaos actions.
	ConditionSelected ConditionType = "Selected"

	// ConditionAllInjected indicates the faults have been successfully injected to all target pods.
	ConditionAllInjected ConditionType = "AllInjected"

	// ConditionAllRecovered indicates the injected faults have been successfully restored from all target pods.
	ConditionAllRecovered ConditionType = "AllRecovered"

	// ConditionPaused  indicates the chaos experiment is in the "Paused" step.
	ConditionPaused ConditionType = "Paused"
)

type Controller

type Controller struct {
	ctrl.Manager
	logr.Logger
	// contains filtered or unexported fields
}

Controller reconciles a Reference object

func (*Controller) Finalize

func (r *Controller) Finalize(obj client.Object) error

func (*Controller) Finalizer

func (r *Controller) Finalizer() string

func (*Controller) Reconcile

func (r *Controller) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile is part of the main kubernetes reconciliation loop which aims to move the current state of the cluster closer to the desired state.

func (*Controller) Watchers

func (r *Controller) Watchers() predicate.Funcs

type DesiredPhase

type DesiredPhase string
const (
	// RunningPhase target is to make all selected targets (container or pod) into "Injected" phase.
	RunningPhase DesiredPhase = "Run"
	// StoppedPhase target  is to make all selected targets (container or pod) into "NotInjected" phase.
	StoppedPhase DesiredPhase = "Stop"
)

func (DesiredPhase) Run

func (d DesiredPhase) Run() bool

func (DesiredPhase) Stop

func (d DesiredPhase) Stop() bool

type ExperimentStatus

type ExperimentStatus struct {
	DesiredPhase `mapstructure:",omitempty"`
}

type Fault

type Fault = unstructured.Unstructured

Jump to

Keyboard shortcuts

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