v1alpha1

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (
	// DefaultStaleNodeTimeout is the default timeout for considering nodes stale
	DefaultStaleNodeTimeout = 1 * time.Hour
	// MinStaleNodeTimeout is the minimum allowed stale node timeout
	MinStaleNodeTimeout = 1 * time.Minute
	// MaxStaleNodeTimeout is the maximum allowed stale node timeout
	MaxStaleNodeTimeout = 24 * time.Hour
	// DefaultWatchdogPath is the default path to the watchdog device
	DefaultWatchdogPath = "/dev/watchdog"
	// DefaultWatchdogTimeout is the default watchdog timeout duration
	DefaultWatchdogTimeout = 60 * time.Second
	// MinWatchdogTimeout is the minimum allowed watchdog timeout
	MinWatchdogTimeout = 10 * time.Second
	// MaxWatchdogTimeout is the maximum allowed watchdog timeout
	MaxWatchdogTimeout = 300 * time.Second
	// DefaultPetIntervalMultiple is the default multiple for calculating pet interval from watchdog timeout
	DefaultPetIntervalMultiple = 4
	// MinPetIntervalMultiple is the minimum allowed pet interval multiple
	MinPetIntervalMultiple = 3
	// MaxPetIntervalMultiple is the maximum allowed pet interval multiple
	MaxPetIntervalMultiple = 20
	// DefaultIOTimeout is the default timeout for I/O operations
	DefaultIOTimeout = 2 * time.Second
	// MinIOTimeout is the minimum allowed I/O timeout
	MinIOTimeout = 100 * time.Millisecond
	// MaxIOTimeout is the maximum allowed I/O timeout
	MaxIOTimeout = 5 * time.Minute
	// DefaultRebootMethod is the default reboot method for self-fencing
	DefaultRebootMethod = "systemctl-reboot"
	// DefaultSBDTimeoutSeconds is the default SBD timeout in seconds
	DefaultSBDTimeoutSeconds = 30
	// MinSBDTimeoutSeconds is the minimum allowed SBD timeout in seconds
	MinSBDTimeoutSeconds = 10
	// MaxSBDTimeoutSeconds is the maximum allowed SBD timeout in seconds
	MaxSBDTimeoutSeconds = 300
	// DefaultSBDUpdateInterval is the default interval for SBD device updates
	DefaultSBDUpdateInterval = 5 * time.Second
	// MinSBDUpdateInterval is the minimum allowed SBD update interval
	MinSBDUpdateInterval = 1 * time.Second
	// MaxSBDUpdateInterval is the maximum allowed SBD update interval
	MaxSBDUpdateInterval = 60 * time.Second
	// DefaultPeerCheckInterval is the default interval for peer check operations
	DefaultPeerCheckInterval = 5 * time.Second
	// MinPeerCheckInterval is the minimum allowed peer check interval
	MinPeerCheckInterval = 1 * time.Second
	// MaxPeerCheckInterval is the maximum allowed peer check interval
	MaxPeerCheckInterval = 60 * time.Second
)

Constants for SBDConfig validation and defaults

Variables

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

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

	Spec   SBDConfigSpec   `json:"spec,omitempty"`
	Status SBDConfigStatus `json:"status,omitempty"`
}

SBDConfig is the Schema for the sbdconfigs API.

func (*SBDConfig) DeepCopy

func (in *SBDConfig) DeepCopy() *SBDConfig

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

func (*SBDConfig) DeepCopyInto

func (in *SBDConfig) DeepCopyInto(out *SBDConfig)

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

func (*SBDConfig) DeepCopyObject

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

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

func (*SBDConfig) GetCondition

func (c *SBDConfig) GetCondition(conditionType SBDConfigConditionType) *metav1.Condition

GetCondition returns the condition with the given type if it exists

func (*SBDConfig) IsConditionFalse

func (c *SBDConfig) IsConditionFalse(conditionType SBDConfigConditionType) bool

IsConditionFalse returns true if the condition is set to False

func (*SBDConfig) IsConditionTrue

func (c *SBDConfig) IsConditionTrue(conditionType SBDConfigConditionType) bool

IsConditionTrue returns true if the condition is set to True

func (*SBDConfig) IsConditionUnknown

func (c *SBDConfig) IsConditionUnknown(conditionType SBDConfigConditionType) bool

IsConditionUnknown returns true if the condition is set to Unknown or doesn't exist

func (*SBDConfig) IsDaemonSetReady

func (c *SBDConfig) IsDaemonSetReady() bool

IsDaemonSetReady returns true if the DaemonSet is ready

func (*SBDConfig) IsReady

func (c *SBDConfig) IsReady() bool

IsReady returns true if the SBDConfig is ready overall

func (*SBDConfig) IsSharedStorageReady

func (c *SBDConfig) IsSharedStorageReady() bool

IsSharedStorageReady returns true if shared storage is ready

func (*SBDConfig) SetCondition

func (c *SBDConfig) SetCondition(
	conditionType SBDConfigConditionType,
	status metav1.ConditionStatus,
	reason, message string,
)

SetCondition sets the given condition on the SBDConfig

type SBDConfigConditionType

type SBDConfigConditionType string

SBDConfigConditionType represents the type of condition for SBDConfig

const (
	// SBDConfigConditionDaemonSetReady indicates whether the SBD agent DaemonSet is ready
	SBDConfigConditionDaemonSetReady SBDConfigConditionType = "DaemonSetReady"
	// SBDConfigConditionSharedStorageReady indicates whether shared storage is properly configured
	SBDConfigConditionSharedStorageReady SBDConfigConditionType = "SharedStorageReady"
	// SBDConfigConditionReady indicates the overall readiness of the SBDConfig
	SBDConfigConditionReady SBDConfigConditionType = "Ready"
)

type SBDConfigList

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

SBDConfigList contains a list of SBDConfig.

func (*SBDConfigList) DeepCopy

func (in *SBDConfigList) DeepCopy() *SBDConfigList

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

func (*SBDConfigList) DeepCopyInto

func (in *SBDConfigList) DeepCopyInto(out *SBDConfigList)

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

func (*SBDConfigList) DeepCopyObject

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

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

type SBDConfigSpec

type SBDConfigSpec struct {

	// SbdWatchdogPath is the path to the watchdog device on the host
	// If not specified, defaults to "/dev/watchdog"
	// +kubebuilder:default="/dev/watchdog"
	// +optional
	SbdWatchdogPath string `json:"sbdWatchdogPath,omitempty"`

	// Image is the container image for the SBD agent DaemonSet
	// If not specified, defaults to sbd-agent from the same registry/org/tag as the operator
	// +optional
	Image string `json:"image,omitempty"`

	// ImagePullPolicy defines the pull policy for the SBD agent container image.
	// Valid values are Always, Never, and IfNotPresent.
	// Defaults to IfNotPresent for production stability.
	// +kubebuilder:validation:Enum=Always;Never;IfNotPresent
	// +kubebuilder:default="IfNotPresent"
	// +optional
	ImagePullPolicy string `json:"imagePullPolicy,omitempty"`

	// SharedStorageClass is the name of a StorageClass to use for creating shared storage.
	// When specified, the controller will create a PVC using this StorageClass and mount it
	// in the agent DaemonSet for cross-node coordination, slot assignment, and shared configuration data.
	// The StorageClass must support ReadWriteMany (RWX) access mode.
	// +optional
	SharedStorageClass string `json:"sharedStorageClass,omitempty"`

	// NodeSelector is a selector which must be true for the SBD agent pod to fit on a node.
	// This allows users to control which nodes the SBD agent runs on by specifying node labels.
	// If not specified, defaults to worker nodes only (node-role.kubernetes.io/worker: "").
	// The selector is merged with the default requirement for kubernetes.io/os=linux.
	// +optional
	NodeSelector map[string]string `json:"nodeSelector,omitempty"`

	// StaleNodeTimeout defines how long to wait before considering a node stale and removing it from slot mapping
	// This timeout determines when inactive nodes are cleaned up from the shared SBD device slot assignments.
	// Nodes that haven't updated their heartbeat within this duration will be considered stale and their slots
	// will be freed for reuse by new nodes. The value must be at least 1 minute.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(s|m|h))+$"
	// +kubebuilder:default="1h"
	// +optional
	StaleNodeTimeout *metav1.Duration `json:"staleNodeTimeout,omitempty"`

	// WatchdogTimeout defines the watchdog timeout duration for the hardware/software watchdog device.
	// This determines how long the system will wait before triggering a reboot if the watchdog is not pet.
	// The pet interval is calculated as watchdog timeout divided by the pet interval multiple.
	// The value must be between 10 seconds and 300 seconds (5 minutes).
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(s|m|h))+$"
	// +kubebuilder:default="60s"
	// +optional
	WatchdogTimeout *metav1.Duration `json:"watchdogTimeout,omitempty"`

	// PetIntervalMultiple defines the multiple used to calculate the pet interval from the watchdog timeout.
	// Pet interval = watchdog timeout / pet interval multiple.
	// This ensures the pet interval is always shorter than the watchdog timeout with a safety margin.
	// The value must be between 3.0 and 20.0, with 4.0 providing a good balance of safety and efficiency.
	// +kubebuilder:validation:Minimum=3
	// +kubebuilder:validation:Maximum=20
	// +kubebuilder:default=4
	// +optional
	PetIntervalMultiple *int32 `json:"petIntervalMultiple,omitempty"`

	// LogLevel defines the logging level for the SBD agent pods.
	// Valid values are debug, info, warn, and error.
	// Debug provides the most verbose logging, while error only logs error messages.
	// +kubebuilder:validation:Enum=debug;info;warn;error
	// +kubebuilder:default="info"
	// +optional
	LogLevel string `json:"logLevel,omitempty"`

	// IOTimeout defines the timeout for SBD I/O operations.
	// This determines how long the system will wait for SBD I/O operations to complete.
	// The value must be between 100 milliseconds and 5 minutes.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
	// +kubebuilder:default="2s"
	// +optional
	IOTimeout *metav1.Duration `json:"iotimeout,omitempty"`

	// RebootMethod defines the method to use for self-fencing when a node needs to be rebooted.
	// Valid values are "panic" (immediate kernel panic), "systemctl-reboot" (graceful systemctl reboot),
	// and "none" (disable self-fencing, rely only on watchdog hardware timeout).
	// Panic provides the fastest failover but less graceful shutdown, while systemctl-reboot allows
	// for graceful service shutdown but may be slower. The "none" option disables agent-initiated
	// self-fencing and relies solely on hardware watchdog timeout for node fencing.
	// +kubebuilder:validation:Enum=panic;systemctl-reboot;none
	// +kubebuilder:default="panic"
	// +optional
	RebootMethod string `json:"rebootMethod,omitempty"`

	// SBDTimeoutSeconds defines the SBD timeout in seconds, which determines the heartbeat interval.
	// The heartbeat interval is calculated as SBD timeout divided by 2.
	// This value controls how quickly the cluster can detect and respond to node failures.
	// The value must be between 10 and 300 seconds.
	// +kubebuilder:validation:Minimum=10
	// +kubebuilder:validation:Maximum=300
	// +kubebuilder:default=30
	// +optional
	SBDTimeoutSeconds *int32 `json:"sbdTimeoutSeconds,omitempty"`

	// SBDUpdateInterval defines the interval for updating the SBD device with node status information.
	// This determines how frequently each node writes its status to the shared SBD device.
	// More frequent updates provide faster failure detection but increase I/O load on the shared storage.
	// The value must be between 1 second and 60 seconds.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(s|m))+$"
	// +kubebuilder:default="5s"
	// +optional
	SBDUpdateInterval *metav1.Duration `json:"sbdUpdateInterval,omitempty"`

	// PeerCheckInterval defines the interval for checking peer node heartbeats in the SBD device.
	// This determines how frequently each node reads and processes heartbeats from other nodes.
	// More frequent checks provide faster peer failure detection but increase I/O load on the shared storage.
	// The value must be between 1 second and 60 seconds.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(s|m))+$"
	// +kubebuilder:default="5s"
	// +optional
	PeerCheckInterval *metav1.Duration `json:"peerCheckInterval,omitempty"`
}

SBDConfigSpec defines the desired state of SBDConfig.

func (*SBDConfigSpec) DeepCopy

func (in *SBDConfigSpec) DeepCopy() *SBDConfigSpec

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

func (*SBDConfigSpec) DeepCopyInto

func (in *SBDConfigSpec) DeepCopyInto(out *SBDConfigSpec)

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

func (*SBDConfigSpec) GetIOTimeout

func (s *SBDConfigSpec) GetIOTimeout() time.Duration

GetIOTimeout returns the SBD I/O timeout with default fallback

func (*SBDConfigSpec) GetImagePullPolicy

func (s *SBDConfigSpec) GetImagePullPolicy() string

GetImagePullPolicy returns the image pull policy with default fallback

func (*SBDConfigSpec) GetImageWithOperatorImage

func (s *SBDConfigSpec) GetImageWithOperatorImage(operatorImage string) string

GetImageWithOperatorImage returns the agent image with default fallback The default is constructed from the operator's image by replacing the image name with sbd-agent

func (*SBDConfigSpec) GetLogLevel

func (s *SBDConfigSpec) GetLogLevel() string

GetLogLevel returns the log level with default fallback

func (*SBDConfigSpec) GetNodeSelector

func (s *SBDConfigSpec) GetNodeSelector() map[string]string

GetNodeSelector returns the node selector with default fallback to worker nodes only

func (*SBDConfigSpec) GetPeerCheckInterval

func (s *SBDConfigSpec) GetPeerCheckInterval() time.Duration

GetPeerCheckInterval returns the peer check interval with default fallback

func (*SBDConfigSpec) GetPetInterval

func (s *SBDConfigSpec) GetPetInterval() time.Duration

GetPetInterval calculates the pet interval based on watchdog timeout and multiple

func (*SBDConfigSpec) GetPetIntervalMultiple

func (s *SBDConfigSpec) GetPetIntervalMultiple() int32

GetPetIntervalMultiple returns the pet interval multiple with default fallback

func (*SBDConfigSpec) GetRebootMethod

func (s *SBDConfigSpec) GetRebootMethod() string

GetRebootMethod returns the reboot method with default fallback

func (*SBDConfigSpec) GetSBDTimeoutSeconds

func (s *SBDConfigSpec) GetSBDTimeoutSeconds() int32

GetSBDTimeoutSeconds returns the SBD timeout in seconds with default fallback

func (*SBDConfigSpec) GetSBDUpdateInterval

func (s *SBDConfigSpec) GetSBDUpdateInterval() time.Duration

GetSBDUpdateInterval returns the SBD update interval with default fallback

func (*SBDConfigSpec) GetSbdWatchdogPath

func (s *SBDConfigSpec) GetSbdWatchdogPath() string

GetSbdWatchdogPath returns the watchdog path with default fallback

func (*SBDConfigSpec) GetSharedStorageAccessModes

func (s *SBDConfigSpec) GetSharedStorageAccessModes() []string

GetSharedStorageAccessModes returns the fixed access modes

func (*SBDConfigSpec) GetSharedStorageMountPath

func (s *SBDConfigSpec) GetSharedStorageMountPath() string

GetSharedStorageMountPath returns the shared storage mount path The controller automatically chooses a sensible path for mounting shared storage

func (*SBDConfigSpec) GetSharedStoragePVCName

func (s *SBDConfigSpec) GetSharedStoragePVCName(sbdConfigName string) string

GetSharedStoragePVCName returns the generated PVC name for shared storage

func (*SBDConfigSpec) GetSharedStorageSize

func (s *SBDConfigSpec) GetSharedStorageSize() string

GetSharedStorageSize returns the fixed storage size

func (*SBDConfigSpec) GetSharedStorageStorageClass

func (s *SBDConfigSpec) GetSharedStorageStorageClass() string

GetSharedStorageStorageClass returns the storage class name for shared storage

func (*SBDConfigSpec) GetStaleNodeTimeout

func (s *SBDConfigSpec) GetStaleNodeTimeout() time.Duration

GetStaleNodeTimeout returns the stale node timeout with default fallback

func (*SBDConfigSpec) GetWatchdogTimeout

func (s *SBDConfigSpec) GetWatchdogTimeout() time.Duration

GetWatchdogTimeout returns the watchdog timeout with default fallback

func (*SBDConfigSpec) HasSharedStorage

func (s *SBDConfigSpec) HasSharedStorage() bool

HasSharedStorage returns true if shared storage is configured

func (*SBDConfigSpec) ValidateAll

func (s *SBDConfigSpec) ValidateAll() error

ValidateAll validates all configuration values

func (*SBDConfigSpec) ValidateIOTimeout

func (s *SBDConfigSpec) ValidateIOTimeout() error

ValidateIOTimeout validates the SBD I/O timeout value

func (*SBDConfigSpec) ValidateImagePullPolicy

func (s *SBDConfigSpec) ValidateImagePullPolicy() error

ValidateImagePullPolicy validates the image pull policy value

func (*SBDConfigSpec) ValidatePeerCheckInterval

func (s *SBDConfigSpec) ValidatePeerCheckInterval() error

ValidatePeerCheckInterval validates the peer check interval value

func (*SBDConfigSpec) ValidatePetIntervalMultiple

func (s *SBDConfigSpec) ValidatePetIntervalMultiple() error

ValidatePetIntervalMultiple validates the pet interval multiple value

func (*SBDConfigSpec) ValidatePetIntervalTiming

func (s *SBDConfigSpec) ValidatePetIntervalTiming() error

ValidatePetIntervalTiming validates that the calculated pet interval is appropriate

func (*SBDConfigSpec) ValidateRebootMethod

func (s *SBDConfigSpec) ValidateRebootMethod() error

ValidateRebootMethod validates the reboot method value

func (*SBDConfigSpec) ValidateSBDTimeoutSeconds

func (s *SBDConfigSpec) ValidateSBDTimeoutSeconds() error

ValidateSBDTimeoutSeconds validates the SBD timeout value

func (*SBDConfigSpec) ValidateSBDUpdateInterval

func (s *SBDConfigSpec) ValidateSBDUpdateInterval() error

ValidateSBDUpdateInterval validates the SBD update interval value

func (*SBDConfigSpec) ValidateSharedStorageClass

func (s *SBDConfigSpec) ValidateSharedStorageClass() error

ValidateSharedStorageClass validates the shared storage class configuration

func (*SBDConfigSpec) ValidateStaleNodeTimeout

func (s *SBDConfigSpec) ValidateStaleNodeTimeout() error

ValidateStaleNodeTimeout validates the stale node timeout value

func (*SBDConfigSpec) ValidateWatchdogTimeout

func (s *SBDConfigSpec) ValidateWatchdogTimeout() error

ValidateWatchdogTimeout validates the watchdog timeout value

type SBDConfigStatus

type SBDConfigStatus struct {

	// Conditions represent the latest available observations of the SBDConfig's current state
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// ReadyNodes is the number of nodes where the SBD agent is ready
	ReadyNodes int32 `json:"readyNodes,omitempty"`

	// TotalNodes is the total number of nodes where the SBD agent should be deployed
	TotalNodes int32 `json:"totalNodes,omitempty"`
}

SBDConfigStatus defines the observed state of SBDConfig.

func (*SBDConfigStatus) DeepCopy

func (in *SBDConfigStatus) DeepCopy() *SBDConfigStatus

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

func (*SBDConfigStatus) DeepCopyInto

func (in *SBDConfigStatus) DeepCopyInto(out *SBDConfigStatus)

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

type SBDConfigValidator

type SBDConfigValidator struct{}

SBDConfigValidator implements admission webhook validation for SBDConfig

func (*SBDConfigValidator) DeepCopy

func (in *SBDConfigValidator) DeepCopy() *SBDConfigValidator

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

func (*SBDConfigValidator) DeepCopyInto

func (in *SBDConfigValidator) DeepCopyInto(out *SBDConfigValidator)

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

func (*SBDConfigValidator) SetupWithManager

func (v *SBDConfigValidator) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the webhook with the Manager.

func (*SBDConfigValidator) ValidateCreate

func (v *SBDConfigValidator) ValidateCreate(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

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

func (*SBDConfigValidator) ValidateDelete

func (v *SBDConfigValidator) ValidateDelete(ctx context.Context, obj runtime.Object) (admission.Warnings, error)

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

func (*SBDConfigValidator) ValidateUpdate

func (v *SBDConfigValidator) ValidateUpdate(
	ctx context.Context,
	oldObj, newObj runtime.Object,
) (admission.Warnings, error)

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

type SBDRemediationConditionType

type SBDRemediationConditionType string

SBDRemediationConditionType represents the type of condition for StorageBasedRemediation

const (
	// SBDRemediationConditionLeadershipAcquired indicates whether the operator has acquired leadership for fencing
	SBDRemediationConditionLeadershipAcquired SBDRemediationConditionType = "LeadershipAcquired"
	// SBDRemediationConditionFencingInProgress indicates whether fencing is currently in progress
	SBDRemediationConditionFencingInProgress SBDRemediationConditionType = "FencingInProgress"
	// SBDRemediationConditionFencingSucceeded indicates whether fencing completed successfully
	SBDRemediationConditionFencingSucceeded SBDRemediationConditionType = "FencingSucceeded"
	// SBDRemediationConditionReady indicates the overall readiness of the remediation
	SBDRemediationConditionReady SBDRemediationConditionType = "Ready"
)

type SBDRemediationReason

type SBDRemediationReason string

SBDRemediationReason represents the reason for the current remediation state

const (
	// SBDRemediationReasonHeartbeatTimeout indicates the node stopped sending heartbeats
	SBDRemediationReasonHeartbeatTimeout SBDRemediationReason = "HeartbeatTimeout"
	// SBDRemediationReasonNodeUnresponsive indicates the node is unresponsive
	SBDRemediationReasonNodeUnresponsive SBDRemediationReason = "NodeUnresponsive"
	// SBDRemediationReasonManualFencing indicates manual fencing was requested
	SBDRemediationReasonManualFencing SBDRemediationReason = "ManualFencing"
	// SBDRemediationReasonNone indicates no fencing is required
	SBDRemediationReasonNone SBDRemediationReason = "None"
)

type StorageBasedRemediation

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

	Spec   StorageBasedRemediationSpec   `json:"spec,omitempty"`
	Status StorageBasedRemediationStatus `json:"status,omitempty"`
}

StorageBasedRemediation is the Schema for the sbdremediations API.

func (*StorageBasedRemediation) DeepCopy

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

func (*StorageBasedRemediation) DeepCopyInto

func (in *StorageBasedRemediation) DeepCopyInto(out *StorageBasedRemediation)

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

func (*StorageBasedRemediation) DeepCopyObject

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

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

func (*StorageBasedRemediation) GetCondition

func (r *StorageBasedRemediation) GetCondition(conditionType SBDRemediationConditionType) *metav1.Condition

GetCondition returns the condition with the given type if it exists

func (*StorageBasedRemediation) HasLeadership

func (r *StorageBasedRemediation) HasLeadership() bool

HasLeadership returns true if leadership has been acquired

func (*StorageBasedRemediation) IsConditionFalse

func (r *StorageBasedRemediation) IsConditionFalse(conditionType SBDRemediationConditionType) bool

IsConditionFalse returns true if the condition is set to False

func (*StorageBasedRemediation) IsConditionTrue

func (r *StorageBasedRemediation) IsConditionTrue(conditionType SBDRemediationConditionType) bool

IsConditionTrue returns true if the condition is set to True

func (*StorageBasedRemediation) IsConditionUnknown

func (r *StorageBasedRemediation) IsConditionUnknown(conditionType SBDRemediationConditionType) bool

IsConditionUnknown returns true if the condition is set to Unknown or doesn't exist

func (*StorageBasedRemediation) IsFencingInProgress

func (r *StorageBasedRemediation) IsFencingInProgress() bool

IsFencingInProgress returns true if fencing is currently in progress

func (*StorageBasedRemediation) IsFencingSucceeded

func (r *StorageBasedRemediation) IsFencingSucceeded() bool

IsFencingSucceeded returns true if fencing has completed successfully

func (*StorageBasedRemediation) IsReady

func (r *StorageBasedRemediation) IsReady() bool

IsReady returns true if the remediation is ready (either succeeded or failed)

func (*StorageBasedRemediation) SetCondition

func (r *StorageBasedRemediation) SetCondition(
	conditionType SBDRemediationConditionType,
	status metav1.ConditionStatus,
	reason, message string,
)

SetCondition sets the given condition on the StorageBasedRemediation

type StorageBasedRemediationList

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

StorageBasedRemediationList contains a list of StorageBasedRemediation.

func (*StorageBasedRemediationList) DeepCopy

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

func (*StorageBasedRemediationList) DeepCopyInto

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

func (*StorageBasedRemediationList) DeepCopyObject

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

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

type StorageBasedRemediationSpec

type StorageBasedRemediationSpec struct {
	// Reason specifies why this node needs to be fenced
	// +kubebuilder:validation:Enum=HeartbeatTimeout;NodeUnresponsive;ManualFencing
	// +kubebuilder:default=NodeUnresponsive
	Reason SBDRemediationReason `json:"reason,omitempty"`

	// TimeoutSeconds specifies how long to wait before considering the fencing failed
	// +kubebuilder:validation:Minimum=30
	// +kubebuilder:validation:Maximum=300
	// +kubebuilder:default=60
	TimeoutSeconds int32 `json:"timeoutSeconds,omitempty"`
}

StorageBasedRemediationSpec defines the desired state of StorageBasedRemediation.

func (*StorageBasedRemediationSpec) DeepCopy

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

func (*StorageBasedRemediationSpec) DeepCopyInto

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

type StorageBasedRemediationStatus

type StorageBasedRemediationStatus struct {
	// Conditions represent the latest available observations of the remediation's current state
	// +patchMergeKey=type
	// +patchStrategy=merge
	// +listType=map
	// +listMapKey=type
	Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type"`

	// LastUpdateTime is the time when this status was last updated
	LastUpdateTime *metav1.Time `json:"lastUpdateTime,omitempty"`

	// NodeID is the numeric ID assigned to the target node for SBD operations
	NodeID *uint16 `json:"nodeID,omitempty"`

	// FenceMessageWritten indicates if the fence message was successfully written to the SBD device
	FenceMessageWritten bool `json:"fenceMessageWritten,omitempty"`

	// OperatorInstance identifies which operator instance is handling this remediation
	OperatorInstance string `json:"operatorInstance,omitempty"`
}

StorageBasedRemediationStatus defines the observed state of StorageBasedRemediation.

func (*StorageBasedRemediationStatus) DeepCopy

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

func (*StorageBasedRemediationStatus) DeepCopyInto

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

type StorageBasedRemediationTemplate

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

	Spec   StorageBasedRemediationTemplateSpec   `json:"spec,omitempty"`
	Status StorageBasedRemediationTemplateStatus `json:"status,omitempty"`
}

StorageBasedRemediationTemplate is the Schema for the sbdremediationtemplates API. +operator-sdk:csv:customresourcedefinitions:resources={{"StorageBasedRemediationTemplate","v1alpha1","storagebasedremediationtemplates"}}

func (*StorageBasedRemediationTemplate) DeepCopy

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

func (*StorageBasedRemediationTemplate) DeepCopyInto

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

func (*StorageBasedRemediationTemplate) DeepCopyObject

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

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

type StorageBasedRemediationTemplateList

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

StorageBasedRemediationTemplateList contains a list of StorageBasedRemediationTemplate.

func (*StorageBasedRemediationTemplateList) DeepCopy

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

func (*StorageBasedRemediationTemplateList) DeepCopyInto

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

func (*StorageBasedRemediationTemplateList) DeepCopyObject

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

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

type StorageBasedRemediationTemplateResource

type StorageBasedRemediationTemplateResource struct {
	Spec StorageBasedRemediationSpec `json:"spec"`
}

func (*StorageBasedRemediationTemplateResource) DeepCopy

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

func (*StorageBasedRemediationTemplateResource) DeepCopyInto

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

type StorageBasedRemediationTemplateSpec

type StorageBasedRemediationTemplateSpec struct {

	// Template defines the desired state of StorageBasedRemediationTemplate
	// +operator-sdk:csv:customresourcedefinitions:type=spec
	Template StorageBasedRemediationTemplateResource `json:"template"`
}

StorageBasedRemediationTemplateSpec defines the desired state of StorageBasedRemediationTemplate.

func (*StorageBasedRemediationTemplateSpec) DeepCopy

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

func (*StorageBasedRemediationTemplateSpec) DeepCopyInto

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

type StorageBasedRemediationTemplateStatus

type StorageBasedRemediationTemplateStatus struct {
}

StorageBasedRemediationTemplateStatus defines the observed state of StorageBasedRemediationTemplate.

func (*StorageBasedRemediationTemplateStatus) DeepCopy

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

func (*StorageBasedRemediationTemplateStatus) 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