v1beta1

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Overview

Package v1beta1 is the v1beta1 version of the API.

Index

Constants

View Source
const (
	// ClusterReady means cluster is ready.
	ClusterReady = "Ready"

	// ClusterInit indicates whether the cluster has been initialised (optional) after joining.
	// In some cases, some extra customized operations are needed to provide some add-on features, such as
	// multi-cluster networking, etc.
	// With this feature, Clusternet provides a hook to help perform such operations.
	ClusterInit = "ClusterInit"
)
View Source
const (
	VERSION = "v1beta1"
)

Variables

View Source
var (
	// SchemeBuilder initializes a scheme builder
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme is a global function that registers this API group & version to a scheme
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: clusters.GroupName, Version: VERSION}

SchemeGroupVersion is group version used to register these objects

Functions

func Kind

func Kind(kind string) schema.GroupKind

Kind takes an unqualified kind and returns back a Group qualified GroupKind

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ApprovedResult

type ApprovedResult string
const (
	RequestDenied   ApprovedResult = "Denied"
	RequestApproved ApprovedResult = "Approved"
	RequestFailed   ApprovedResult = "Failed"
)

These are the possible results for a cluster registration request.

type ClusterRegistrationRequest

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

	Spec   ClusterRegistrationRequestSpec   `json:"spec,omitempty"`
	Status ClusterRegistrationRequestStatus `json:"status,omitempty"`
}

ClusterRegistrationRequest is the Schema for the clusterregistrationrequests API

func (*ClusterRegistrationRequest) DeepCopy

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

func (*ClusterRegistrationRequest) DeepCopyInto

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

func (*ClusterRegistrationRequest) DeepCopyObject

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

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

type ClusterRegistrationRequestList

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

ClusterRegistrationRequestList contains a list of ClusterRegistrationRequest

func (*ClusterRegistrationRequestList) DeepCopy

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

func (*ClusterRegistrationRequestList) DeepCopyInto

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

func (*ClusterRegistrationRequestList) DeepCopyObject

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

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

type ClusterRegistrationRequestSpec

type ClusterRegistrationRequestSpec struct {
	// ClusterID, a Random (Version 4) UUID, is a unique value in time and space value representing for child cluster.
	// It is typically generated by the clusternet agent on the successful creation of a "clusternet-agent" Lease
	// in the child cluster.
	// Also it is not allowed to change on PUT operations.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
	ClusterID types.UID `json:"clusterId"`

	// ClusterType denotes the type of the child cluster.
	//
	// +optional
	// +kubebuilder:validation:Type=string
	ClusterType ClusterType `json:"clusterType,omitempty"`

	// ClusterName is the cluster name.
	// a lower case alphanumeric characters or '-', and must start and end with an alphanumeric character
	//
	// +optional
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:MaxLength=30
	// +kubebuilder:validation:Pattern="[a-z0-9]([-a-z0-9]*[a-z0-9])?([a-z0-9]([-a-z0-9]*[a-z0-9]))*"
	ClusterName string `json:"clusterName,omitempty"`

	// ClusterNamespace is the dedicated namespace of the cluster.
	//
	// +optional
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Pattern="[a-z0-9]([-a-z0-9]*[a-z0-9])?"
	ClusterNamespace string `json:"clusterNamespace,omitempty"`

	// ClusterLabels is the labels of the child cluster.
	//
	// +optional
	// +kubebuilder:validation:Type=object
	ClusterLabels map[string]string `json:"clusterLabels,omitempty"`

	// SyncMode decides how to sync resources from parent cluster to child cluster.
	//
	// +optional
	// +kubebuilder:default=Pull
	// +kubebuilder:validation:Enum=Push;Pull;Dual
	SyncMode ClusterSyncMode `json:"syncMode,omitempty"`
}

ClusterRegistrationRequestSpec defines the desired state of ClusterRegistrationRequest

func (*ClusterRegistrationRequestSpec) DeepCopy

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

func (*ClusterRegistrationRequestSpec) DeepCopyInto

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

type ClusterRegistrationRequestStatus

type ClusterRegistrationRequestStatus struct {
	// DedicatedNamespace is a dedicated namespace for the child cluster, which is created in the parent cluster.
	//
	// +optional
	DedicatedNamespace string `json:"dedicatedNamespace,omitempty"`

	// DedicatedToken is populated by clusternet-hub when Result is RequestApproved.
	// With this token, the client could have full access on the resources created in DedicatedNamespace.
	//
	// +optional
	DedicatedToken []byte `json:"token,omitempty"`

	// CACertificate is the public certificate that is the root of trust for parent cluster
	// The certificate is encoded in PEM format.
	//
	// +optional
	CACertificate []byte `json:"caCertificate,omitempty"`

	// Result indicates whether this request has been approved.
	// When all necessary objects have been created and ready for child cluster registration,
	// this field will be set to "Approved". If any illegal updates on this object, "Illegal" will be set to this filed.
	//
	// +optional
	Result *ApprovedResult `json:"result,omitempty"`

	// ErrorMessage tells the reason why the request is not approved successfully.
	//
	// +optional
	ErrorMessage string `json:"errorMessage,omitempty"`

	// ManagedClusterName is the name of ManagedCluster object in the parent cluster corresponding to the child cluster
	//
	// +optional
	ManagedClusterName string `json:"managedClusterName,omitempty"`
}

ClusterRegistrationRequestStatus defines the observed state of ClusterRegistrationRequest

func (*ClusterRegistrationRequestStatus) DeepCopy

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

func (*ClusterRegistrationRequestStatus) DeepCopyInto

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

type ClusterSyncMode

type ClusterSyncMode string
const (
	// Push means that all the resource changes in the parent cluster will be synchronized, pushed and applied to child clusters.
	Push ClusterSyncMode = "Push"

	// Pull means that the agent, known as 'clusternet-agent', running in the child cluster will watch, synchronize
	// and apply all the resource changes from the parent cluster to child cluster.
	Pull ClusterSyncMode = "Pull"

	// Dual combines both Push and Pull mode.
	Dual ClusterSyncMode = "Dual"
)

These are the valid values for ClusterSyncMode

type ClusterType

type ClusterType string
const (
	EdgeCluster ClusterType = "EdgeCluster"

	StandardCluster ClusterType = "StandardCluster"
)

These are the valid values for ClusterType

type ManagedCluster

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

	Spec   ManagedClusterSpec   `json:"spec,omitempty"`
	Status ManagedClusterStatus `json:"status,omitempty"`
}

ManagedCluster is the Schema for the managedclusters API

func (*ManagedCluster) DeepCopy

func (in *ManagedCluster) DeepCopy() *ManagedCluster

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

func (*ManagedCluster) DeepCopyInto

func (in *ManagedCluster) DeepCopyInto(out *ManagedCluster)

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

func (*ManagedCluster) DeepCopyObject

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

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

type ManagedClusterList

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

ManagedClusterList contains a list of ManagedCluster

func (*ManagedClusterList) DeepCopy

func (in *ManagedClusterList) DeepCopy() *ManagedClusterList

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

func (*ManagedClusterList) DeepCopyInto

func (in *ManagedClusterList) DeepCopyInto(out *ManagedClusterList)

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

func (*ManagedClusterList) DeepCopyObject

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

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

type ManagedClusterSpec

type ManagedClusterSpec struct {
	// ClusterID, a Random (Version 4) UUID, is a unique value in time and space value representing for child cluster.
	// It is typically generated by the clusternet agent on the successful creation of a "clusternet-agent" Lease
	// in the child cluster.
	// Also it is not allowed to change on PUT operations.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}"
	ClusterID types.UID `json:"clusterId"`

	// ClusterType denotes the type of the child cluster.
	//
	// +optional
	// +kubebuilder:validation:Type=string
	ClusterType ClusterType `json:"clusterType,omitempty"`

	// ClusterInitBaseName denotes the name of a Base used for initialization.
	// Also a taint "clusters.clusternet.io/initialization:NoSchedule" will be added during the operation and removed
	// after successful initialization.
	// If this cluster has got an annotation "clusters.clusternet.io/skip-cluster-init", this field will be empty.
	// Normally this field is fully managed by clusternet-controller-manager and immutable.
	//
	// +kubebuilder:validation:Optional
	// +kubebuilder:validation:XValidation:rule="self == oldSelf",message="clusterInitBaseName is immutable"
	// +kubebuilder:validation:MaxLength=512
	ClusterInitBaseName *string `json:"clusterInitBaseName"`

	// SyncMode decides how to sync resources from parent cluster to child cluster.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Enum=Push;Pull;Dual
	SyncMode ClusterSyncMode `json:"syncMode"`

	// Taints has the "effect" on any resource that does not tolerate the Taint.
	// +optional
	Taints []corev1.Taint `json:"taints,omitempty"`
}

ManagedClusterSpec defines the desired state of ManagedCluster +kubebuilder:validation:XValidation:rule="!has(oldSelf.clusterInitBaseName) || has(self.clusterInitBaseName)", message="clusterInitBaseName is required once set"

func (*ManagedClusterSpec) DeepCopy

func (in *ManagedClusterSpec) DeepCopy() *ManagedClusterSpec

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

func (*ManagedClusterSpec) DeepCopyInto

func (in *ManagedClusterSpec) DeepCopyInto(out *ManagedClusterSpec)

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

type ManagedClusterStatus

type ManagedClusterStatus struct {
	// lastObservedTime is the time when last status from the series was seen before last heartbeat.
	// RFC 3339 date and time at which the object was acknowledged by the Clusternet Agent.
	// +optional
	LastObservedTime metav1.Time `json:"lastObservedTime,omitempty"`

	// k8sVersion is the Kubernetes version of the cluster
	// +optional
	KubernetesVersion string `json:"k8sVersion,omitempty"`

	// agentVersion is the clusternet agent version of the sub cluster
	// +optional
	AgentVersion string `json:"agentVersion,omitempty"`

	// platform indicates the running platform of the cluster
	// +optional
	Platform string `json:"platform,omitempty"`

	// APIServerURL indicates the advertising url/address of managed Kubernetes cluster
	// +optional
	APIServerURL string `json:"apiserverURL,omitempty"`

	// Healthz indicates the healthz status of the cluster
	// which is deprecated since Kubernetes v1.16. Please use Livez and Readyz instead.
	// Leave it here only for compatibility.
	// +optional
	Healthz bool `json:"healthz"`

	// Livez indicates the livez status of the cluster
	// +optional
	Livez bool `json:"livez"`

	// Readyz indicates the readyz status of the cluster
	// +optional
	Readyz bool `json:"readyz"`

	// AppPusher indicates whether to allow parent cluster deploying applications in Push or Dual Mode.
	// Mainly for security concerns.
	// +optional
	AppPusher *bool `json:"appPusher,omitempty"`

	// UseSocket indicates whether to use socket proxy when connecting to child cluster.
	//
	// +optional
	UseSocket bool `json:"useSocket,omitempty"`

	// KubeQPS controls the number of queries per second allowed for this connection.
	// Used by deployer in Clusternet to control the qps to current child cluster.
	//
	// +optional
	KubeQPS float32 `json:"kubeQPS,omitempty"`

	// KubeBurst allows extra queries to accumulate when a client is exceeding its rate.
	// Used by deployer in Clusternet to control the burst to current child cluster.
	//
	// +optional
	KubeBurst int32 `json:"kubeBurst,omitempty"`

	// Allocatable is the sum of allocatable resources for nodes in the cluster
	// +optional
	Allocatable corev1.ResourceList `json:"allocatable,omitempty"`

	// Capacity is the sum of capacity resources for nodes in the cluster
	// +optional
	Capacity corev1.ResourceList `json:"capacity,omitempty"`

	// ClusterCIDR is the CIDR range of the cluster
	// +optional
	ClusterCIDR string `json:"clusterCIDR,omitempty"`

	// ServcieCIDR is the CIDR range of the services
	// +optional
	ServiceCIDR string `json:"serviceCIDR,omitempty"`

	// NodeStatistics is the info summary of nodes in the cluster
	// +optional
	NodeStatistics NodeStatistics `json:"nodeStatistics,omitempty"`

	// PodStatistics is the info summary of pods in the cluster
	// +optional
	PodStatistics *PodStatistics `json:"podStatistics,omitempty"`

	// ResourceUsage is the cpu(m) and memory(Mi) already used in the cluster
	// +optional
	ResourceUsage *ResourceUsage `json:"resourceUsage,omitempty"`

	// Conditions is an array of current cluster conditions.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// heartbeatFrequencySeconds is the frequency at which the agent reports current cluster status
	// +optional
	HeartbeatFrequencySeconds *int64 `json:"heartbeatFrequencySeconds,omitempty"`

	// PredictorEnabled indicates whether predictor is enabled.
	// +optional
	PredictorEnabled bool `json:"predictorEnabled,omitempty"`

	// PredictorAddress shows the predictor address
	// +optional
	PredictorAddress string `json:"predictorAddress,omitempty"`

	// PredictorDirectAccess indicates whether the predictor can be accessed directly by clusternet-scheduler
	// +optional
	PredictorDirectAccess bool `json:"predictorDirectAccess"`
}

ManagedClusterStatus defines the observed state of ManagedCluster

func (*ManagedClusterStatus) DeepCopy

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

func (*ManagedClusterStatus) DeepCopyInto

func (in *ManagedClusterStatus) DeepCopyInto(out *ManagedClusterStatus)

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

type NodeStatistics

type NodeStatistics struct {
	// ReadyNodes is the number of ready nodes in the cluster
	// +optional
	ReadyNodes int32 `json:"readyNodes,omitempty"`

	// NotReadyNodes is the number of not ready nodes in the cluster
	// +optional
	NotReadyNodes int32 `json:"notReadyNodes,omitempty"`

	// UnknownNodes is the number of unknown nodes in the cluster
	// +optional
	UnknownNodes int32 `json:"unknownNodes,omitempty"`

	// LostNodes is the number of states lost nodes in the cluster
	// +optional
	LostNodes int32 `json:"lostNodes,omitempty"`
}

func (*NodeStatistics) DeepCopy

func (in *NodeStatistics) DeepCopy() *NodeStatistics

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

func (*NodeStatistics) DeepCopyInto

func (in *NodeStatistics) DeepCopyInto(out *NodeStatistics)

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

type PodStatistics added in v0.11.0

type PodStatistics struct {
	// RunningPods is the number of running pods in the cluster
	// +optional
	RunningPods int32 `json:"runningPods,omitempty"`

	// TotalPods is the number of all pods in the cluster
	// +optional
	TotalPods int32 `json:"totalPods,omitempty"`
}

func (*PodStatistics) DeepCopy added in v0.11.0

func (in *PodStatistics) DeepCopy() *PodStatistics

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

func (*PodStatistics) DeepCopyInto added in v0.11.0

func (in *PodStatistics) DeepCopyInto(out *PodStatistics)

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

type ResourceUsage added in v0.11.0

type ResourceUsage struct {
	// CpuUsage is the total cpu(m) already used in the whole cluster, k8s reserved not include
	// +optional
	CpuUsage resource.Quantity `json:"cpuUsage,omitempty"`

	// MemoryUsage is the total memory(Mi) already used in the whole cluster, k8s reserved not include
	// +optional
	MemoryUsage resource.Quantity `json:"memoryUsage,omitempty"`
}

func (*ResourceUsage) DeepCopy added in v0.11.0

func (in *ResourceUsage) DeepCopy() *ResourceUsage

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

func (*ResourceUsage) DeepCopyInto added in v0.11.0

func (in *ResourceUsage) DeepCopyInto(out *ResourceUsage)

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