v1alpha1

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 15

Documentation

Overview

+k8s:deepcopy-gen=package,register +groupName=core.kcp.io +k8s:openapi-gen=true

Index

Constants

View Source
const (
	// LogicalClusterName is the name of the LogicalCluster singleton.
	LogicalClusterName = "cluster"

	// LogicalClusterFinalizer attached to the owner of thw LogicalCluster resource (usually a Workspace) so that we can control
	// deletion of LogicalCluster resources.
	LogicalClusterFinalizer = "core.kcp.io/logicalcluster"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var RootShard = "root"

RootShard holds a name of the root shard.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: core.GroupName, Version: "v1alpha1"}

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 LogicalCluster

type LogicalCluster struct {
	v1.TypeMeta `json:",inline"`
	// +optional
	v1.ObjectMeta `json:"metadata,omitempty"`
	// +optional
	Spec LogicalClusterSpec `json:"spec,omitempty"`
	// +optional
	Status LogicalClusterStatus `json:"status,omitempty"`
}

LogicalCluster describes the current logical cluster. It is used to authorize requests to the logical cluster and to track state.

A LogicalCluster is always named "cluster".

+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=kcp +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The current phase (e.g. Scheduling, Initializing, Ready, Deleting)" +kubebuilder:printcolumn:name="URL",type=string,JSONPath=`.status.URL`,description="URL to access the logical cluster" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*LogicalCluster) DeepCopy

func (in *LogicalCluster) DeepCopy() *LogicalCluster

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

func (*LogicalCluster) DeepCopyInto

func (in *LogicalCluster) DeepCopyInto(out *LogicalCluster)

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

func (*LogicalCluster) DeepCopyObject

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

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

func (*LogicalCluster) GetConditions

func (in *LogicalCluster) GetConditions() conditionsv1alpha1.Conditions

func (*LogicalCluster) SetConditions

func (in *LogicalCluster) SetConditions(c conditionsv1alpha1.Conditions)

type LogicalClusterInitializer

type LogicalClusterInitializer string

LogicalClusterInitializer is a unique string corresponding to a logical cluster initialization controller.

+kubebuilder:validation:Pattern:="^([a-z0-9]([-a-z0-9]*[a-z0-9])?(:[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(:[a-z0-9][a-z0-9]([-a-z0-9]*[a-z0-9])?))|(system:.+)$"

type LogicalClusterList

type LogicalClusterList struct {
	v1.TypeMeta `json:",inline"`
	v1.ListMeta `json:"metadata"`

	Items []LogicalCluster `json:"items"`
}

LogicalClusterList is a list of LogicalCluster

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*LogicalClusterList) DeepCopy

func (in *LogicalClusterList) DeepCopy() *LogicalClusterList

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

func (*LogicalClusterList) DeepCopyInto

func (in *LogicalClusterList) DeepCopyInto(out *LogicalClusterList)

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

func (*LogicalClusterList) DeepCopyObject

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

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

type LogicalClusterOwner

type LogicalClusterOwner struct {
	// apiVersion is the group and API version of the owner.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Pattern=`^([^/]+/)?[^/]+$`
	APIVersion string `json:"apiVersion"`

	// resource is API resource to access the owner.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Resource string `json:"resource"`

	// name is the name of the owner.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// namespace is the optional namespace of the owner.
	//
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// cluster is the logical cluster in which the owner is located.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:MinLength=1
	Cluster string `json:"cluster"`

	// UID is the UID of the owner.
	//
	// +required
	// +kubebuilder:validation:Required
	UID types.UID `json:"uid"`
}

LogicalClusterOwner is a reference to a resource controlling the life-cycle of a LogicalCluster.

func (*LogicalClusterOwner) DeepCopy

func (in *LogicalClusterOwner) DeepCopy() *LogicalClusterOwner

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

func (*LogicalClusterOwner) DeepCopyInto

func (in *LogicalClusterOwner) DeepCopyInto(out *LogicalClusterOwner)

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

type LogicalClusterPhaseType

type LogicalClusterPhaseType string

LogicalClusterPhaseType is the type of the current phase of the logical cluster.

+kubebuilder:validation:Enum=Scheduling;Initializing;Ready

const (
	LogicalClusterPhaseScheduling   LogicalClusterPhaseType = "Scheduling"
	LogicalClusterPhaseInitializing LogicalClusterPhaseType = "Initializing"
	LogicalClusterPhaseReady        LogicalClusterPhaseType = "Ready"
)

type LogicalClusterSpec

type LogicalClusterSpec struct {
	// DirectlyDeletable indicates that this logical cluster can be directly deleted by the user
	// from within by deleting the LogicalCluster object.
	//
	// +optional
	// +kubebuilder:default=false
	DirectlyDeletable bool `json:"directlyDeletable,omitempty"`

	// owner is a reference to a resource controlling the life-cycle of this logical cluster.
	// On deletion of the LogicalCluster, the finalizer core.kcp.io/logicalcluster is
	// removed from the owner.
	//
	// When this object is deleted, but the owner is not deleted, the owner is deleted
	// too.
	//
	// +optional
	Owner *LogicalClusterOwner `json:"owner,omitempty"`

	// initializers are set on creation by the system and copied to status when
	// initialization starts.
	//
	// +optional
	Initializers []LogicalClusterInitializer `json:"initializers,omitempty"`
}

LogicalClusterSpec is the specification of the LogicalCluster resource.

func (*LogicalClusterSpec) DeepCopy

func (in *LogicalClusterSpec) DeepCopy() *LogicalClusterSpec

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

func (*LogicalClusterSpec) DeepCopyInto

func (in *LogicalClusterSpec) DeepCopyInto(out *LogicalClusterSpec)

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

type LogicalClusterStatus

type LogicalClusterStatus struct {
	// url is the address under which the Kubernetes-cluster-like endpoint
	// can be found. This URL can be used to access the logical cluster with standard Kubernetes
	// client libraries and command line tools.
	//
	// +kubebuilder:format:uri
	URL string `json:"URL,omitempty"`

	// Phase of the logical cluster (Initializing, Ready).
	//
	// +kubebuilder:default=Scheduling
	Phase LogicalClusterPhaseType `json:"phase,omitempty"`

	// Current processing state of the LogicalCluster.
	// +optional
	Conditions conditionsv1alpha1.Conditions `json:"conditions,omitempty"`

	// initializers are set on creation by the system and must be cleared
	// by a controller before the logical cluster can be used. The LogicalCluster object
	// will stay in the phase "Initializing" state until all initializers are cleared.
	//
	// +optional
	Initializers []LogicalClusterInitializer `json:"initializers,omitempty"`
}

LogicalClusterStatus communicates the observed state of the Workspace.

func (*LogicalClusterStatus) DeepCopy

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

func (*LogicalClusterStatus) DeepCopyInto

func (in *LogicalClusterStatus) DeepCopyInto(out *LogicalClusterStatus)

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

type Shard

type Shard struct {
	v1.TypeMeta `json:",inline"`
	// +optional
	v1.ObjectMeta `json:"metadata,omitempty"`

	// +optional
	Spec ShardSpec `json:"spec,omitempty"`

	// +optional
	Status ShardStatus `json:"status,omitempty"`
}

Shard describes a kcp instance on which a number of logical clusters will live

+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:subresource:status +kubebuilder:resource:scope=Cluster,categories=kcp +kubebuilder:printcolumn:name="Region",type=string,JSONPath=`.metadata.labels['region']`,description="The region this workspace is in" +kubebuilder:printcolumn:name="URL",type=string,JSONPath=`.spec.baseURL`,description="Type URL to directly connect to the shard" +kubebuilder:printcolumn:name="External URL",type=string,JSONPath=`.spec.externalURL`,description="The URL exposed in logical clusters created on that shard" +kubebuilder:printcolumn:name="Age",type="date",JSONPath=".metadata.creationTimestamp"

func (*Shard) DeepCopy

func (in *Shard) DeepCopy() *Shard

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

func (*Shard) DeepCopyInto

func (in *Shard) DeepCopyInto(out *Shard)

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

func (*Shard) DeepCopyObject

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

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

func (*Shard) GetConditions

func (in *Shard) GetConditions() v1alpha1.Conditions

func (*Shard) SetConditions

func (in *Shard) SetConditions(c v1alpha1.Conditions)

type ShardList

type ShardList struct {
	v1.TypeMeta `json:",inline"`
	v1.ListMeta `json:"metadata"`

	Items []Shard `json:"items"`
}

ShardList is a list of shard instances

+k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object

func (*ShardList) DeepCopy

func (in *ShardList) DeepCopy() *ShardList

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

func (*ShardList) DeepCopyInto

func (in *ShardList) DeepCopyInto(out *ShardList)

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

func (*ShardList) DeepCopyObject

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

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

type ShardSpec

type ShardSpec struct {
	// baseURL is the address of the KCP shard for direct connections, e.g. by some
	// front-proxy doing the fan-out to the shards.
	//
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Format=uri
	// +kubebuilder:validation:MinLength=1
	BaseURL string `json:"baseURL"`

	// externalURL is the externally visible address presented to users in Workspace URLs.
	// Changing this will break all existing logical clusters on that shard, i.e. existing
	// kubeconfigs of clients will be invalid. Hence, when changing this value, the old
	// URL used by clients must keep working.
	//
	// The external address will not be unique if a front-proxy does a fan-out to
	// shards, but all logical cluster clients will talk to the front-proxy. In that case,
	// put the address of the front-proxy here.
	//
	// Note that movement of shards is only possible (in the future) between shards
	// that share a common external URL.
	//
	// This will be defaulted to the value of the baseURL.
	//
	// +optional
	// +kubebuilder:validation:Format=uri
	// +kubebuilder:validation:MinLength=1
	ExternalURL string `json:"externalURL,omitempty"`

	// virtualWorkspaceURL is the address of the virtual workspace apiserver associated with this shard.
	// It can be a direct address, an address of a front-proxy or even an address of an LB.
	// As of today this address is assigned to APIExports.
	//
	// This will be defaulted to the value of the baseURL.
	//
	// +optional
	// +kubebuilder:validation:Format=uri
	// +kubebuilder:validation:MinLength=1
	VirtualWorkspaceURL string `json:"virtualWorkspaceURL,omitempty"`
}

ShardSpec holds the desired state of the Shard.

func (*ShardSpec) DeepCopy

func (in *ShardSpec) DeepCopy() *ShardSpec

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

func (*ShardSpec) DeepCopyInto

func (in *ShardSpec) DeepCopyInto(out *ShardSpec)

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

type ShardStatus

type ShardStatus struct {
	// Set of integer resources that logical clusters can be scheduled into
	// +optional
	Capacity corev1.ResourceList `json:"capacity,omitempty"`

	// Current processing state of the Shard.
	// +optional
	Conditions v1alpha1.Conditions `json:"conditions,omitempty"`
}

ShardStatus communicates the observed state of the Shard.

func (*ShardStatus) DeepCopy

func (in *ShardStatus) DeepCopy() *ShardStatus

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

func (*ShardStatus) DeepCopyInto

func (in *ShardStatus) DeepCopyInto(out *ShardStatus)

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL