v1alpha1

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2023 License: Apache-2.0 Imports: 5 Imported by: 8

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

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

	// NamespaceOffloadingResource is the resource name used to register the NamespaceOffloading CRD.
	NamespaceOffloadingResource = "namespaceoffloadings"

	// GroupResource is group and resource used to register these objects.
	GroupResource = schema.GroupResource{Group: GroupVersion.Group, Resource: NamespaceOffloadingResource}

	// NamespaceOffloadingGroupVersionResource is the group version resource used to register the NamespaceOffloading CRD.
	NamespaceOffloadingGroupVersionResource = GroupVersion.WithResource(NamespaceOffloadingResource)

	// 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 NamespaceMappingStrategyType

type NamespaceMappingStrategyType string

NamespaceMappingStrategyType represents different strategies to map local and remote namespace names.

const (
	// EnforceSameNameMappingStrategyType -> the remote namespace is assigned the same name of the local one
	// (the creation may fail in case of conflicts).
	EnforceSameNameMappingStrategyType NamespaceMappingStrategyType = "EnforceSameName"
	// DefaultNameMappingStrategyType -> the remote namespace is assigned a default name which ensures uniqueness
	// and avoids conflicts (localNamespaceName-localClusterID).
	DefaultNameMappingStrategyType NamespaceMappingStrategyType = "DefaultName"
)

type NamespaceOffloading

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

	Spec   NamespaceOffloadingSpec   `json:"spec"`
	Status NamespaceOffloadingStatus `json:"status,omitempty"`
}

NamespaceOffloading is the Schema for the namespaceoffloadings API.

func (*NamespaceOffloading) DeepCopy

func (in *NamespaceOffloading) DeepCopy() *NamespaceOffloading

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

func (*NamespaceOffloading) DeepCopyInto

func (in *NamespaceOffloading) DeepCopyInto(out *NamespaceOffloading)

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

func (*NamespaceOffloading) DeepCopyObject

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

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

type NamespaceOffloadingList

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

NamespaceOffloadingList contains a list of NamespaceOffloading.

func (*NamespaceOffloadingList) DeepCopy

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

func (*NamespaceOffloadingList) DeepCopyInto

func (in *NamespaceOffloadingList) DeepCopyInto(out *NamespaceOffloadingList)

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

func (*NamespaceOffloadingList) DeepCopyObject

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

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

type NamespaceOffloadingSpec

type NamespaceOffloadingSpec struct {
	//  NamespaceMappingStrategy allows users to map local and remote namespace names according to two
	//  different strategies: "DefaultName", which ensures uniqueness and prevents conflicts, and "EnforceSameName",
	//  which enforces the same name at the cost of possible conflicts.
	// +kubebuilder:validation:Enum="EnforceSameName";"DefaultName"
	// +kubebuilder:default="DefaultName"
	// +kubebuilder:validation:Optional
	NamespaceMappingStrategy NamespaceMappingStrategyType `json:"namespaceMappingStrategy"`

	// PodOffloadingStrategy allows users to configure how pods in this namespace are offloaded, according to three
	// different strategies: "Local" (i.e. no pod offloading is performed), "Remote" (i.e. all pods are offloaded
	// in remote clusters), "LocalAndRemote" (i.e. no constraints are enforced besides the ones
	// specified by the ClusterSelector).
	// +kubebuilder:validation:Enum="Local";"Remote";"LocalAndRemote"
	// +kubebuilder:default="LocalAndRemote"
	// +kubebuilder:validation:Optional
	PodOffloadingStrategy PodOffloadingStrategyType `json:"podOffloadingStrategy"`

	// ClusterSelector allows users to select a specific subset of remote clusters to perform
	// pod offloading by means of the standard Kubernetes NodeSelector approach
	// (https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity).
	// A cluster selector with no NodeSelectorTerms matches all clusters.
	ClusterSelector corev1.NodeSelector `json:"clusterSelector,omitempty"`
}

NamespaceOffloadingSpec defines the desired state of NamespaceOffloading.

func (*NamespaceOffloadingSpec) DeepCopy

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

func (*NamespaceOffloadingSpec) DeepCopyInto

func (in *NamespaceOffloadingSpec) DeepCopyInto(out *NamespaceOffloadingSpec)

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

type NamespaceOffloadingStatus

type NamespaceOffloadingStatus struct {
	// RemoteNamespaceName is the remote namespace name chosen by means of the NamespaceMappingStrategy.
	RemoteNamespaceName string `json:"remoteNamespaceName,omitempty"`
	// OffloadingPhase -> informs users about namespaces offloading status:
	// "Ready" (i.e. remote Namespaces have been correctly created on previously selected clusters.)
	// "NoClusterSelected" (i.e. no cluster matches user constraints.)
	// "InProgress" (i.e. remote Namespaces' creation is still ongoing.)
	// "SomeFailed" (i.e. there was an error during creation of some remote Namespaces.)
	// "AllFailed" (i.e. there was an error during creation of all remote Namespaces.)
	// "Terminating" (i.e. remote namespaces are undergoing graceful termination.)
	OffloadingPhase OffloadingPhaseType `json:"offloadingPhase,omitempty"`
	// RemoteNamespacesConditions -> allows user to verify remote Namespaces' presence and status on all remote
	// clusters through RemoteNamespaceCondition.
	RemoteNamespacesConditions map[string]RemoteNamespaceConditions `json:"remoteNamespacesConditions,omitempty"`
	// The generation observed by the NamespaceOffloading controller.
	// This field allows external tools (e.g., liqoctl) to detect whether a spec modification has already been processed
	// or not (i.e., whether the status should be expected to be up-to-date or not), and thus act accordingly.
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`
}

NamespaceOffloadingStatus defines the observed state of NamespaceOffloading.

func (*NamespaceOffloadingStatus) DeepCopy

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

func (*NamespaceOffloadingStatus) DeepCopyInto

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

type OffloadingPhaseType

type OffloadingPhaseType string

OffloadingPhaseType represents different namespaces offloading status.

const (
	// ReadyOffloadingPhaseType -> remote Namespaces have been correctly created on previously selected clusters.
	ReadyOffloadingPhaseType OffloadingPhaseType = "Ready"
	// NoClusterSelectedOffloadingPhaseType -> no cluster matches user constraints.
	NoClusterSelectedOffloadingPhaseType OffloadingPhaseType = "NoClusterSelected"
	// InProgressOffloadingPhaseType -> remote Namespaces' creation is still ongoing.
	InProgressOffloadingPhaseType OffloadingPhaseType = "InProgress"
	// SomeFailedOffloadingPhaseType -> there was an error during creation of some remote Namespaces.
	SomeFailedOffloadingPhaseType OffloadingPhaseType = "SomeFailed"
	// AllFailedOffloadingPhaseType -> there was an error during creation of all remote Namespaces.
	AllFailedOffloadingPhaseType OffloadingPhaseType = "AllFailed"
	// TerminatingOffloadingPhaseType -> means remote namespaces are undergoing graceful termination.
	TerminatingOffloadingPhaseType OffloadingPhaseType = "Terminating"
)

type PodOffloadingStrategyType

type PodOffloadingStrategyType string

PodOffloadingStrategyType represents different strategies to offload pods in this Namespace.

const (
	// LocalPodOffloadingStrategyType -> the pods in this namespace can be scheduled on the local cluster only
	// (i.e. no pod offloading occurs).
	LocalPodOffloadingStrategyType PodOffloadingStrategyType = "Local"
	// RemotePodOffloadingStrategyType -> the pods in this namespace can be scheduled on remote clusters only, possibly
	// filtered through the ClusterSelector field.
	RemotePodOffloadingStrategyType PodOffloadingStrategyType = "Remote"
	// LocalAndRemotePodOffloadingStrategyType -> the pods in this namespace can be scheduled on both the local
	// and remote clusters, the latter possibly filtered through the ClusterSelector field.
	LocalAndRemotePodOffloadingStrategyType PodOffloadingStrategyType = "LocalAndRemote"
)

type RemoteNamespaceCondition

type RemoteNamespaceCondition struct {
	// Type of remote namespace controller condition.
	Type RemoteNamespaceConditionType `json:"type"`
	// Status of the condition, one of True, False, Unknown.
	Status corev1.ConditionStatus `json:"status"`
	// LastTransitionTime -> timestamp for when the Namespace last transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
	// Reason -> Machine-readable, UpperCamelCase text indicating the reason for the condition's last transition.
	Reason string `json:"reason,omitempty"`
	// Message -> Human-readable message indicating details about the last status transition.
	Message string `json:"message,omitempty"`
}

RemoteNamespaceCondition contains details about state of remote namespace.

func (*RemoteNamespaceCondition) DeepCopy

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

func (*RemoteNamespaceCondition) DeepCopyInto

func (in *RemoteNamespaceCondition) DeepCopyInto(out *RemoteNamespaceCondition)

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

type RemoteNamespaceConditionType

type RemoteNamespaceConditionType string

RemoteNamespaceConditionType represents different conditions that a remote namespace could assume.

const (
	// NamespaceOffloadingRequired, informs users if their namespace has been offloaded on this cluster or not.
	NamespaceOffloadingRequired RemoteNamespaceConditionType = "OffloadingRequired"
	// NamespaceReady, remote Namespace is correctly created and ready to be used.
	NamespaceReady RemoteNamespaceConditionType = "Ready"
)

These are valid conditions of a remote namespace.

type RemoteNamespaceConditions

type RemoteNamespaceConditions []RemoteNamespaceCondition

RemoteNamespaceConditions list of RemoteNamespaceCondition.

func (RemoteNamespaceConditions) DeepCopy

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

func (RemoteNamespaceConditions) 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