v1alpha1

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the remediation v1alpha1 API group +kubebuilder:object:generate=true +groupName=remediation.medik8s.io

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "remediation.medik8s.io", 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
)

Functions

This section is empty.

Types

type Backoff

type Backoff struct {
	//todo rename to strategy instead of type? not sure we need to support more backoff types
	Type BackoffType `json:"type"`
	// Expects a string of decimal numbers each with optional
	// fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m".
	// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type=string
	Limit metav1.Duration `json:"duration"`
}

func (*Backoff) DeepCopy

func (in *Backoff) DeepCopy() *Backoff

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

func (*Backoff) DeepCopyInto

func (in *Backoff) DeepCopyInto(out *Backoff)

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

type BackoffType

type BackoffType string
const (
	BackoffTypeExponential BackoffType = "exponential"
)

type NodeHealthCheck

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

	Spec   NodeHealthCheckSpec   `json:"spec,omitempty"`
	Status NodeHealthCheckStatus `json:"status,omitempty"`
}

NodeHealthCheck is the Schema for the nodehealthchecks API +operator-sdk:csv:customresourcedefinitions:resources={{"NodeHealthCheck","v1alpha1","nodehealthchecks"}}

func (*NodeHealthCheck) DeepCopy

func (in *NodeHealthCheck) DeepCopy() *NodeHealthCheck

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

func (*NodeHealthCheck) DeepCopyInto

func (in *NodeHealthCheck) DeepCopyInto(out *NodeHealthCheck)

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

func (*NodeHealthCheck) DeepCopyObject

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

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

type NodeHealthCheckList

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

NodeHealthCheckList contains a list of NodeHealthCheck

func (*NodeHealthCheckList) DeepCopy

func (in *NodeHealthCheckList) DeepCopy() *NodeHealthCheckList

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

func (*NodeHealthCheckList) DeepCopyInto

func (in *NodeHealthCheckList) DeepCopyInto(out *NodeHealthCheckList)

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

func (*NodeHealthCheckList) DeepCopyObject

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

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

type NodeHealthCheckSpec

type NodeHealthCheckSpec struct {
	// Label selector to match nodes whose health will be exercised.
	// Note: An empty selector will match all nodes.
	// +optional
	//+operator-sdk:csv:customresourcedefinitions:type=spec
	Selector metav1.LabelSelector `json:"selector"`

	// UnhealthyConditions contains a list of the conditions that determine
	// whether a node is considered unhealthy.  The conditions are combined in a
	// logical OR, i.e. if any of the conditions is met, the node is unhealthy.
	//
	// +optional
	// +kubebuilder:default:={{type:Ready,status:False,duration:"300s"},{type:Ready,status:Unknown,duration:"300s"}}
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	UnhealthyConditions []UnhealthyCondition `json:"unhealthyConditions,omitempty"`

	// Remediation is allowed if at least "MinHealthy" nodes selected by "selector" are healthy.
	// Expects either a positive integer value or a percentage value.
	// Percentage values must be positive whole numbers and are capped at 100%.
	// 100% is valid and will block all remediation.
	// +kubebuilder:default="51%"
	// +kubebuilder:validation:Pattern="^((100|[0-9]{1,2})%|[0-9]+)$"
	// +kubebuilder:validation:Type=string
	//+operator-sdk:csv:customresourcedefinitions:type=spec
	MinHealthy *intstr.IntOrString `json:"minHealthy,omitempty"`

	// RemediationTemplate is a reference to a remediation template
	// provided by an infrastructure provider.
	//
	// If a node needs remediation the controller will create an object from this template
	// and then it should be picked up by a remediation provider.
	//+operator-sdk:csv:customresourcedefinitions:type=spec
	RemediationTemplate *corev1.ObjectReference `json:"remediationTemplate"`

	// PauseRequests will prevent any new remdiation to start, while in-flight remediations
	// keep running. Each entry is free form, and ideally represents the requested party reason
	// for this pausing - i.e:
	//     "imaginary-cluster-upgrade-manager-operator"
	// +optional
	//+operator-sdk:csv:customresourcedefinitions:type=spec
	PauseRequests []string `json:"pauseRequests,omitempty"`

	// TODO document this
	// +optional
	Backoff *Backoff `json:"backoff,omitempty"`
}

NodeHealthCheckSpec defines the desired state of NodeHealthCheck

func (*NodeHealthCheckSpec) DeepCopy

func (in *NodeHealthCheckSpec) DeepCopy() *NodeHealthCheckSpec

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

func (*NodeHealthCheckSpec) DeepCopyInto

func (in *NodeHealthCheckSpec) DeepCopyInto(out *NodeHealthCheckSpec)

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

type NodeHealthCheckStatus

type NodeHealthCheckStatus struct {
	// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="observedNodes",xDescriptors="urn:alm:descriptor:com.tectonic.ui:observedNodes"
	//ObservedNodes specified the number of nodes observed by using the NHC spec.selecor
	ObservedNodes int `json:"observedNodes,omitempty"`

	// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="healthynodes",xDescriptors="urn:alm:descriptor:com.tectonic.ui:healthyNodes"
	//HealthyNodes specified the number of healthy nodes observed
	HealthyNodes int `json:"healthyNodes,omitempty"`

	// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="inFlightRemediations",xDescriptors="urn:alm:descriptor:com.tectonic.ui:inFlightRemediations"
	//InFlightRemediations records the timestamp when remediation triggered per node
	InFlightRemediations map[string]metav1.Time `json:"inFlightRemediations,omitempty"`
}

NodeHealthCheckStatus defines the observed state of NodeHealthCheck

func (*NodeHealthCheckStatus) DeepCopy

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

func (*NodeHealthCheckStatus) DeepCopyInto

func (in *NodeHealthCheckStatus) DeepCopyInto(out *NodeHealthCheckStatus)

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

type UnhealthyCondition

type UnhealthyCondition struct {
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:MinLength=1
	Type corev1.NodeConditionType `json:"type"`

	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:MinLength=1
	Status corev1.ConditionStatus `json:"status"`

	// Duration of the condition specified where a node is considered unhealthy.
	// Expects a string of decimal numbers each with optional
	// fraction and a unit suffix, eg "300ms", "1.5h" or "2h45m".
	// Valid time units are "ns", "us" (or "µs"), "ms", "s", "m", "h".
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type=string
	Duration metav1.Duration `json:"duration"`
}

UnhealthyCondition represents a Node condition type and value with a specified duration. When the named condition has been in the given status for at least the duration value a node is considered unhealthy.

func (*UnhealthyCondition) DeepCopy

func (in *UnhealthyCondition) DeepCopy() *UnhealthyCondition

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

func (*UnhealthyCondition) DeepCopyInto

func (in *UnhealthyCondition) DeepCopyInto(out *UnhealthyCondition)

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