v1alpha1

package
v0.0.0-...-0145ae5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the operator v1alpha1 API group +kubebuilder:object:generate=true +groupName=countermeasure.vilaverde.rocks

Index

Constants

View Source
const (
	ReasonSucceeded            = "Succeeded"
	ReasonReconciling          = "Reconciling"
	ReasonResourceNotAvailable = "ResourceNotAvailable"

	TypeMonitoring = "Monitoring"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "countermeasure.vilaverde.rocks", Version: "v1alpha1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var WebhookClient client.Client

Functions

func ValidateAction

func ValidateAction(a Action) error

func ValidateOnEvent

func ValidateOnEvent(e OnEventSpec) error

func ValidateSpec

func ValidateSpec(spec *CounterMeasureSpec) error

Types

type Action

type Action struct {
	Name string `json:"name"`
	// +kubebuilder:default=true
	RetryEnabled bool `json:"retryEnabled,omitempty"`

	// +kubebuilder:validation:Optional
	Delete *DeleteSpec `json:"delete,omitempty"`
	// +kubebuilder:validation:Optional
	Patch *PatchSpec `json:"patch,omitempty"`

	// The following specs are high level operations for convenience.
	//
	// +kubebuilder:validation:Optional
	Debug *DebugSpec `json:"debug,omitempty"`
	// +kubebuilder:validation:Optional
	Restart *RestartSpec `json:"restart,omitempty"`
}

Action defines an action to be taken when the event source detects a condition that needs attention.

func (*Action) DeepCopy

func (in *Action) DeepCopy() *Action

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

func (*Action) DeepCopyInto

func (in *Action) DeepCopyInto(out *Action)

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

type CounterMeasure

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

	Spec   CounterMeasureSpec   `json:"spec"`
	Status CounterMeasureStatus `json:"status,omitempty"`
}

CounterMeasure is the Schema for the countermeasures API +kubebuilder:printcolumn:name="Dry Run",type=boolean,JSONPath=`.spec.dryRun` +kubebuilder:printcolumn:name="Status",type=string,JSONPath=`.status.lastStatus` +kubebuilder:printcolumn:name="Status Last Changed",type=string,JSONPath=`.status.lastStatusChangeTime` +kubebuilder:resource:shortName=ctm +kubebuilder:singular=countermeasure

func (*CounterMeasure) DeepCopy

func (in *CounterMeasure) DeepCopy() *CounterMeasure

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

func (*CounterMeasure) DeepCopyInto

func (in *CounterMeasure) DeepCopyInto(out *CounterMeasure)

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

func (*CounterMeasure) DeepCopyObject

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

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

func (*CounterMeasure) Default

func (r *CounterMeasure) Default()

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

func (*CounterMeasure) SetupWebhookWithManager

func (r *CounterMeasure) SetupWebhookWithManager(mgr ctrl.Manager) error

func (*CounterMeasure) ValidateCreate

func (r *CounterMeasure) ValidateCreate() error

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

func (*CounterMeasure) ValidateDelete

func (r *CounterMeasure) ValidateDelete() error

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

func (*CounterMeasure) ValidateUpdate

func (r *CounterMeasure) ValidateUpdate(old runtime.Object) error

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

type CounterMeasureList

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

CounterMeasureList contains a list of CounterMeasure

func (*CounterMeasureList) DeepCopy

func (in *CounterMeasureList) DeepCopy() *CounterMeasureList

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

func (*CounterMeasureList) DeepCopyInto

func (in *CounterMeasureList) DeepCopyInto(out *CounterMeasureList)

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

func (*CounterMeasureList) DeepCopyObject

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

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

type CounterMeasureSpec

type CounterMeasureSpec struct {
	OnEvent OnEventSpec `json:"onEvent"`
	Actions []Action    `json:"actions"`
	// +kubebuilder:default=false
	DryRun bool `json:"dryRun,omitempty"`
}

CounterMeasureSpec defines the desired state of CounterMeasure

func (*CounterMeasureSpec) DeepCopy

func (in *CounterMeasureSpec) DeepCopy() *CounterMeasureSpec

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

func (*CounterMeasureSpec) DeepCopyInto

func (in *CounterMeasureSpec) DeepCopyInto(out *CounterMeasureSpec)

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

type CounterMeasureStatus

type CounterMeasureStatus struct {
	LastStatus           StatusType   `json:"lastStatus,omitempty"`
	LastStatusChangeTime *metav1.Time `json:"lastStatusChangeTime,omitempty"`

	Conditions []metav1.Condition `json:"conditions"`
}

CounterMeasureStatus defines the observed state of CounterMeasure

func (*CounterMeasureStatus) DeepCopy

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

func (*CounterMeasureStatus) DeepCopyInto

func (in *CounterMeasureStatus) DeepCopyInto(out *CounterMeasureStatus)

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

type DebugSpec

type DebugSpec struct {
	Name    string       `json:"name,omitempty"`
	Command []string     `json:"command,omitempty"`
	Args    []string     `json:"args,omitempty"`
	Image   string       `json:"image"`
	PodRef  PodReference `json:"podRef"`
	StdIn   bool         `json:"stdin,omitempty"`
	TTY     bool         `json:"tty,omitempty"`
}

DebugSpec Patches a pod with an ephemeral container that can be used to troubleshoot

func (*DebugSpec) DeepCopy

func (in *DebugSpec) DeepCopy() *DebugSpec

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

func (*DebugSpec) DeepCopyInto

func (in *DebugSpec) DeepCopyInto(out *DebugSpec)

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

type DeleteSpec

type DeleteSpec struct {
	TargetObjectRef ObjectReference `json:"targetObjectRef"`
}

func (*DeleteSpec) DeepCopy

func (in *DeleteSpec) DeepCopy() *DeleteSpec

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

func (*DeleteSpec) DeepCopyInto

func (in *DeleteSpec) DeepCopyInto(out *DeleteSpec)

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

type DeploymentReference

type DeploymentReference struct {
	// `namespace` is the namespace of the deployment.
	Namespace string `json:"namespace"`
	// `name` is the name of the deployment.
	Name string `json:"name"`
}

func (*DeploymentReference) DeepCopy

func (in *DeploymentReference) DeepCopy() *DeploymentReference

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

func (*DeploymentReference) DeepCopyInto

func (in *DeploymentReference) DeepCopyInto(out *DeploymentReference)

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

type ObjectReference

type ObjectReference struct {
	// `namespace` is the namespace of the object.
	Namespace string `json:"namespace"`
	// `name` is the name of the object.
	Name string `json:"name"`
	// `kind` is the type of object
	Kind string `json:"kind"`
	// `apiVersion` is the version of the object
	ApiVersion string `json:"apiVersion"`
}

func (*ObjectReference) DeepCopy

func (in *ObjectReference) DeepCopy() *ObjectReference

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

func (*ObjectReference) DeepCopyInto

func (in *ObjectReference) DeepCopyInto(out *ObjectReference)

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

func (*ObjectReference) ToGroupVersionKind

func (o *ObjectReference) ToGroupVersionKind() (schema.GroupVersionKind, error)

type OnEventSpec

type OnEventSpec struct {
	EventName      string                `json:"name"`
	SourceSelector *metav1.LabelSelector `json:"sourceSelector,omitempty"`

	// Defines a policy for how to suppress alerts from triggering actions.
	SuppressionPolicy *SuppressionPolicySpec `json:"suppressionPolicy,omitempty"`
}

PrometheusAlertSpec definition of a monitored prometheus alert

func (*OnEventSpec) DeepCopy

func (in *OnEventSpec) DeepCopy() *OnEventSpec

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

func (*OnEventSpec) DeepCopyInto

func (in *OnEventSpec) DeepCopyInto(out *OnEventSpec)

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

type PatchSpec

type PatchSpec struct {
	TargetObjectRef ObjectReference `json:"targetObjectRef"`
	PatchType       types.PatchType `json:"patchType"`
	YAMLTemplate    string          `json:"yamlTemplate"`
}

PatchSpec defines a patch operation on an existing Custom Resource

func (*PatchSpec) DeepCopy

func (in *PatchSpec) DeepCopy() *PatchSpec

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

func (*PatchSpec) DeepCopyInto

func (in *PatchSpec) DeepCopyInto(out *PatchSpec)

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

type PodReference

type PodReference struct {
	// `namespace` is the namespace of the pod.
	Namespace string `json:"namespace"`
	// `name` is the name of the pod.
	Name string `json:"name"`
	// `container` is the name a container in a pod.
	Container string `json:"container,omitempty"`
}

func (*PodReference) DeepCopy

func (in *PodReference) DeepCopy() *PodReference

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

func (*PodReference) DeepCopyInto

func (in *PodReference) DeepCopyInto(out *PodReference)

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

type RestartSpec

type RestartSpec struct {
	DeploymentRef DeploymentReference `json:"deploymentRef"`
}

func (*RestartSpec) DeepCopy

func (in *RestartSpec) DeepCopy() *RestartSpec

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

func (*RestartSpec) DeepCopyInto

func (in *RestartSpec) DeepCopyInto(out *RestartSpec)

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

type StatusType

type StatusType string
const (
	Monitoring StatusType = "Monitoring"
	Applying   StatusType = "Applying"
	Error      StatusType = "Error"
	Unknown    StatusType = "Unknown"
)

type SuppressionPolicySpec

type SuppressionPolicySpec struct {
	// Defines the duration of the suppression.
	Duration *metav1.Duration `json:"duration,omitempty"`
}

SuppressionPolicySpec Defines a policy to apply to alerts to suppress duplicates

func (*SuppressionPolicySpec) DeepCopy

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

func (*SuppressionPolicySpec) DeepCopyInto

func (in *SuppressionPolicySpec) DeepCopyInto(out *SuppressionPolicySpec)

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

Jump to

Keyboard shortcuts

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