v1alpha1

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	AutomaticRemediationStrategy         = RemediationStrategyType("Automatic")
	ResourceDeletionRemediationStrategy  = RemediationStrategyType("ResourceDeletion")
	OutOfServiceTaintRemediationStrategy = RemediationStrategyType("OutOfServiceTaint")
	DefaultRemediationStrategy           = AutomaticRemediationStrategy
)
View Source
const (
	ConfigCRName = "self-node-remediation-config"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "self-node-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 ConditionType added in v0.9.0

type ConditionType string
const (
	// ProcessingConditionType is the condition type used to signal NHC the remediation status
	ProcessingConditionType ConditionType = "Processing"
	// SucceededConditionType is the condition type used to signal NHC whether the remediation was successful or not
	SucceededConditionType ConditionType = "Succeeded"
	// DisabledConditionType is the condition type used to signal SNR is disabled
	DisabledConditionType ConditionType = "Disabled"
)

type RemediationStrategyType

type RemediationStrategyType string

type SelfNodeRemediation

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

	Spec   SelfNodeRemediationSpec   `json:"spec,omitempty"`
	Status SelfNodeRemediationStatus `json:"status,omitempty"`
}

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

func (*SelfNodeRemediation) DeepCopy

func (in *SelfNodeRemediation) DeepCopy() *SelfNodeRemediation

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

func (*SelfNodeRemediation) DeepCopyInto

func (in *SelfNodeRemediation) DeepCopyInto(out *SelfNodeRemediation)

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

func (*SelfNodeRemediation) DeepCopyObject

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

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

func (*SelfNodeRemediation) SetupWebhookWithManager added in v0.6.0

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

func (*SelfNodeRemediation) ValidateCreate added in v0.6.0

func (r *SelfNodeRemediation) ValidateCreate() (warning admission.Warnings, err error)

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

func (*SelfNodeRemediation) ValidateDelete added in v0.6.0

func (r *SelfNodeRemediation) ValidateDelete() (warning admission.Warnings, err error)

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

func (*SelfNodeRemediation) ValidateUpdate added in v0.6.0

func (r *SelfNodeRemediation) ValidateUpdate(_ runtime.Object) (warning admission.Warnings, err error)

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

type SelfNodeRemediationConfig

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

	Spec   SelfNodeRemediationConfigSpec   `json:"spec,omitempty"`
	Status SelfNodeRemediationConfigStatus `json:"status,omitempty"`
}

SelfNodeRemediationConfig is the Schema for the selfnoderemediationconfigs API in which a user can configure the self node remediation agents +operator-sdk:csv:customresourcedefinitions:resources={{"SelfNodeRemediationConfig","v1alpha1","selfnoderemediationconfigs"}}

func NewDefaultSelfNodeRemediationConfig

func NewDefaultSelfNodeRemediationConfig() SelfNodeRemediationConfig

func (*SelfNodeRemediationConfig) DeepCopy

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

func (*SelfNodeRemediationConfig) DeepCopyInto

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

func (*SelfNodeRemediationConfig) DeepCopyObject

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

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

func (*SelfNodeRemediationConfig) SetupWebhookWithManager

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

func (*SelfNodeRemediationConfig) ValidateCreate

func (r *SelfNodeRemediationConfig) ValidateCreate() (warning admission.Warnings, err error)

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

func (*SelfNodeRemediationConfig) ValidateDelete

func (r *SelfNodeRemediationConfig) ValidateDelete() (warning admission.Warnings, err error)

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

func (*SelfNodeRemediationConfig) ValidateUpdate

func (r *SelfNodeRemediationConfig) ValidateUpdate(_ runtime.Object) (warning admission.Warnings, err error)

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

type SelfNodeRemediationConfigList

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

SelfNodeRemediationConfigList contains a list of SelfNodeRemediationConfig

func (*SelfNodeRemediationConfigList) DeepCopy

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

func (*SelfNodeRemediationConfigList) DeepCopyInto

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

func (*SelfNodeRemediationConfigList) DeepCopyObject

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

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

type SelfNodeRemediationConfigSpec

type SelfNodeRemediationConfigSpec struct {

	// WatchdogFilePath is the watchdog file path that should be available on each node, e.g. /dev/watchdog.
	// +kubebuilder:default=/dev/watchdog
	// +optional
	WatchdogFilePath string `json:"watchdogFilePath,omitempty"`

	// SafeTimeToAssumeNodeRebootedSeconds is the time after which the healthy self node remediation
	// agents will assume the unhealthy node has been rebooted, and it is safe to recover affected workloads.
	// This is extremely important as starting replacement Pods while they are still running on the failed
	// node will likely lead to data corruption and violation of run-once semantics.
	// In an effort to prevent this, the operator ignores values lower than a minimum calculated from the
	// ApiCheckInterval, ApiServerTimeout, MaxApiErrorThreshold, PeerDialTimeout, and PeerRequestTimeout fields,
	// and the unhealthy node's individual watchdog timeout.
	// +optional
	SafeTimeToAssumeNodeRebootedSeconds *int `json:"safeTimeToAssumeNodeRebootedSeconds,omitempty"`

	// The timeout for api-server connectivity check.
	// Valid time units are "ms", "s", "m", "h".
	// +kubebuilder:default:="5s"
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type:=string
	// +optional
	PeerApiServerTimeout *metav1.Duration `json:"peerApiServerTimeout,omitempty"`

	// The frequency for api-server connectivity check.
	// Valid time units are "ms", "s", "m", "h".
	// +kubebuilder:default:="15s"
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type:=string
	// the frequency for api-server connectivity check
	// +optional
	ApiCheckInterval *metav1.Duration `json:"apiCheckInterval,omitempty"`

	// The frequency for updating peers.
	// Valid time units are "ms", "s", "m", "h".
	// +kubebuilder:default:="15m"
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type:=string
	// +optional
	PeerUpdateInterval *metav1.Duration `json:"peerUpdateInterval,omitempty"`

	// Timeout for each api-connectivity check.
	// Valid time units are "ms", "s", "m", "h".
	// +kubebuilder:default:="5s"
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type:=string
	// +optional
	ApiServerTimeout *metav1.Duration `json:"apiServerTimeout,omitempty"`

	// Timeout for establishing connection to peer.
	// Valid time units are "ms", "s", "m", "h".
	// +kubebuilder:default:="5s"
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type:=string
	// +optional
	PeerDialTimeout *metav1.Duration `json:"peerDialTimeout,omitempty"`

	// Timeout for each peer request.
	// Valid time units are "ms", "s", "m", "h".
	// +kubebuilder:default:="5s"
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ns|us|µs|ms|s|m|h))+$"
	// +kubebuilder:validation:Type:=string
	// +optional
	PeerRequestTimeout *metav1.Duration `json:"peerRequestTimeout,omitempty"`

	// After this threshold, the node will start contacting its peers.
	// +kubebuilder:default:=3
	// +kubebuilder:validation:Minimum=1
	// +optional
	MaxApiErrorThreshold int `json:"maxApiErrorThreshold,omitempty"`

	// IsSoftwareRebootEnabled indicates whether self node remediation agent will do software reboot,
	// if the watchdog device can not be used or will use watchdog only,
	// without a fallback to software reboot.
	// +kubebuilder:default=true
	// +optional
	IsSoftwareRebootEnabled bool `json:"isSoftwareRebootEnabled,omitempty"`

	// EndpointHealthCheckUrl is an url that self node remediation agents which run on control-plane node will try to access when they can't contact their peers.
	// This is a part of self diagnostics which will decide whether the node should be remediated or not.
	// It will be ignored when empty (which is the default).
	// +optional
	EndpointHealthCheckUrl string `json:"endpointHealthCheckUrl,omitempty"`

	// HostPort is used for internal communication between SNR agents.
	// +kubebuilder:default:=30001
	// +kubebuilder:validation:Minimum=1
	// +optional
	HostPort int `json:"hostPort,omitempty"`

	// CustomDsTolerations allows to add custom tolerations snr agents that are running on the ds in order to support remediation for different types of nodes.
	// +optional
	CustomDsTolerations []v1.Toleration `json:"customDsTolerations,omitempty"`
}

SelfNodeRemediationConfigSpec defines the desired state of SelfNodeRemediationConfig

func (*SelfNodeRemediationConfigSpec) DeepCopy

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

func (*SelfNodeRemediationConfigSpec) DeepCopyInto

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

type SelfNodeRemediationConfigStatus

type SelfNodeRemediationConfigStatus struct {
}

SelfNodeRemediationConfigStatus defines the observed state of SelfNodeRemediationConfig

func (*SelfNodeRemediationConfigStatus) DeepCopy

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

func (*SelfNodeRemediationConfigStatus) DeepCopyInto

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

type SelfNodeRemediationList

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

SelfNodeRemediationList contains a list of SelfNodeRemediation

func (*SelfNodeRemediationList) DeepCopy

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

func (*SelfNodeRemediationList) DeepCopyInto

func (in *SelfNodeRemediationList) DeepCopyInto(out *SelfNodeRemediationList)

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

func (*SelfNodeRemediationList) DeepCopyObject

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

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

type SelfNodeRemediationSpec

type SelfNodeRemediationSpec struct {
	//RemediationStrategy is the remediation method for unhealthy nodes.
	//Currently, it could be either "Automatic", "OutOfServiceTaint" or "ResourceDeletion".
	//ResourceDeletion will iterate over all pods and VolumeAttachment related to the unhealthy node and delete them.
	//OutOfServiceTaint will add the out-of-service taint which is a new well-known taint "node.kubernetes.io/out-of-service"
	//that enables automatic deletion of pv-attached pods on failed nodes, "out-of-service" taint is only supported on clusters with k8s version 1.26+ or OCP/OKD version 4.13+.
	// Automatic will choose the most appropriate strategy during runtime.
	// +kubebuilder:default:="Automatic"
	// +kubebuilder:validation:Enum=Automatic;ResourceDeletion;OutOfServiceTaint
	RemediationStrategy RemediationStrategyType `json:"remediationStrategy,omitempty"`
}

SelfNodeRemediationSpec defines the desired state of SelfNodeRemediation

func (*SelfNodeRemediationSpec) DeepCopy

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

func (*SelfNodeRemediationSpec) DeepCopyInto

func (in *SelfNodeRemediationSpec) DeepCopyInto(out *SelfNodeRemediationSpec)

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

type SelfNodeRemediationStatus

type SelfNodeRemediationStatus struct {
	//TimeAssumedRebooted is the time by then the unhealthy node assumed to be rebooted
	// +optional
	//+operator-sdk:csv:customresourcedefinitions:type=status
	TimeAssumedRebooted *metav1.Time `json:"timeAssumedRebooted,omitempty"`

	// Phase represents the current phase of remediation,
	// One of: TBD
	// +optional
	//+operator-sdk:csv:customresourcedefinitions:type=status
	Phase *string `json:"phase,omitempty"`

	// LastError captures the last error that occurred during remediation.
	// If no error occurred it would be empty
	//+operator-sdk:csv:customresourcedefinitions:type=status
	LastError string `json:"lastError,omitempty"`

	// +operator-sdk:csv:customresourcedefinitions:type=status,displayName="conditions",xDescriptors="urn:alm:descriptor:com.tectonic.ui:conditions"
	// Represents the observations of a SelfNodeRemediation's current state.
	// Known .status.conditions.type are: "Processing"
	// +listType=map
	// +listMapKey=type
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

SelfNodeRemediationStatus defines the observed state of SelfNodeRemediation

func (*SelfNodeRemediationStatus) DeepCopy

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

func (*SelfNodeRemediationStatus) DeepCopyInto

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

type SelfNodeRemediationTemplate

type SelfNodeRemediationTemplate struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`
	// +required
	Spec   SelfNodeRemediationTemplateSpec   `json:"spec"`
	Status SelfNodeRemediationTemplateStatus `json:"status,omitempty"`
}

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

func NewRemediationTemplates

func NewRemediationTemplates() []*SelfNodeRemediationTemplate

func (*SelfNodeRemediationTemplate) DeepCopy

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

func (*SelfNodeRemediationTemplate) DeepCopyInto

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

func (*SelfNodeRemediationTemplate) DeepCopyObject

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

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

func (*SelfNodeRemediationTemplate) Default added in v0.9.0

func (r *SelfNodeRemediationTemplate) Default()

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

func (*SelfNodeRemediationTemplate) SetupWebhookWithManager

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

func (*SelfNodeRemediationTemplate) ValidateCreate

func (r *SelfNodeRemediationTemplate) ValidateCreate() (warning admission.Warnings, err error)

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

func (*SelfNodeRemediationTemplate) ValidateDelete

func (r *SelfNodeRemediationTemplate) ValidateDelete() (warning admission.Warnings, err error)

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

func (*SelfNodeRemediationTemplate) ValidateUpdate

func (r *SelfNodeRemediationTemplate) ValidateUpdate(_ runtime.Object) (warning admission.Warnings, err error)

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

type SelfNodeRemediationTemplateList

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

SelfNodeRemediationTemplateList contains a list of SelfNodeRemediationTemplate

func (*SelfNodeRemediationTemplateList) DeepCopy

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

func (*SelfNodeRemediationTemplateList) DeepCopyInto

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

func (*SelfNodeRemediationTemplateList) DeepCopyObject

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

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

type SelfNodeRemediationTemplateResource

type SelfNodeRemediationTemplateResource struct {
	Spec SelfNodeRemediationSpec `json:"spec"`
}

func (*SelfNodeRemediationTemplateResource) DeepCopy

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

func (*SelfNodeRemediationTemplateResource) DeepCopyInto

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

type SelfNodeRemediationTemplateSpec

type SelfNodeRemediationTemplateSpec struct {
	// Template defines the desired state of SelfNodeRemediationTemplate
	//+operator-sdk:csv:customresourcedefinitions:type=spec
	Template SelfNodeRemediationTemplateResource `json:"template"`
}

SelfNodeRemediationTemplateSpec defines the desired state of SelfNodeRemediationTemplate

func (*SelfNodeRemediationTemplateSpec) DeepCopy

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

func (*SelfNodeRemediationTemplateSpec) DeepCopyInto

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

type SelfNodeRemediationTemplateStatus

type SelfNodeRemediationTemplateStatus struct {
}

SelfNodeRemediationTemplateStatus defines the observed state of SelfNodeRemediationTemplate

func (*SelfNodeRemediationTemplateStatus) DeepCopy

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

func (*SelfNodeRemediationTemplateStatus) DeepCopyInto

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