v1alpha1

package
v0.3.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2022 License: Apache-2.0 Imports: 8 Imported by: 29

Documentation

Overview

+k8s:deepcopy-gen=package,register +groupName=tenancy.kcp.dev +k8s:openapi-gen=true

Index

Constants

View Source
const (
	// WorkspaceScheduled represents status of the scheduling process for this workspace.
	WorkspaceScheduled conditionsv1alpha1.ConditionType = "WorkspaceScheduled"
	// WorkspaceReasonUnschedulable reason in WorkspaceScheduled WorkspaceCondition means that the scheduler
	// can't schedule the workspace right now, for example due to insufficient resources in the cluster.
	WorkspaceReasonUnschedulable = "Unschedulable"
	// WorkspaceReasonReasonUnknown reason in WorkspaceScheduled means that scheduler has failed for
	// some unexpected reason.
	WorkspaceReasonReasonUnknown = "Unknown"

	// WorkspaceShardValid represents status of the connection process for this workspace.
	WorkspaceShardValid conditionsv1alpha1.ConditionType = "WorkspaceShardValid"
	// WorkspaceShardValidReasonMissingCredentials reason in WorkspaceShardValid condition means that the
	// connection information in the referenced WorkspaceShard could not be found.
	WorkspaceShardValidReasonMissingCredentials = "MissingShardCredentials"
	// WorkspaceShardValidReasonURLInvalid reason in WorkspaceShardValid condition means that the
	// connection information in the referenced WorkspaceShard were invalid.
	WorkspaceShardValidReasonURLInvalid = "InvalidShardURL"
	// WorkspaceShardValidReasonShardNotFound reason in WorkspaceShardValid condition means that the
	// referenced WorkspaceShard object got deleted.
	WorkspaceShardValidReasonShardNotFound = "ShardNotFound"
	// WorkspaceShardValidReasonMissingConnectionInfo reason in WorkspaceShardValid condition means that the
	// referenced WorkspaceShard object lacks connection info.
	WorkspaceShardValidReasonMissingConnectionInfo = "MissingConnectionInfo"
)

These are valid conditions of workspace.

View Source
const (
	// WorkspaceShardCredentialsKey is the key in the referenced credentials secret where kubeconfig data lives.
	WorkspaceShardCredentialsKey = "kubeconfig"

	// WorkspaceShardCredentialsValid represents status of the credentialing process for this workspace shard.
	WorkspaceShardCredentialsValid conditionsv1alpha1.ConditionType = "WorkspaceShardCredentialsValid"
	// WorkspaceShardCredentialsReasonMissing reason in WorkspaceShardCredentialsValid condition means that the
	// credentials referenced in the WorkspaceShard could not be found.
	WorkspaceShardCredentialsReasonMissing = "Missing"
	// WorkspaceShardCredentialsReasonInvalid reason in WorkspaceShardCredentialsValid condition means that the
	// credentials referenced in the WorkspaceShard did not contain valid data in the correct key.
	WorkspaceShardCredentialsReasonInvalid = "Invalid"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var RootCluster = logicalcluster.New("root")

RootCluster is the root of ClusterWorkspace based logical clusters.

View Source
var SchemeGroupVersion = schema.GroupVersion{Group: tenancy.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 ClusterWorkspace

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

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

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

ClusterWorkspace defines a Kubernetes-cluster-like endpoint that holds a default set of resources and exhibits standard Kubernetes API semantics of CRUD operations. It represents the full life-cycle of the persisted data in this workspace in a KCP installation.

ClusterWorkspace is a concrete type that implements a workspace.

+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="Type",type=string,JSONPath=`.spec.type`,description="Type of the workspace" +kubebuilder:printcolumn:name="Phase",type=string,JSONPath=`.status.phase`,description="The current phase (e.g. Scheduling, Initializing, Ready)"

func (*ClusterWorkspace) DeepCopy

func (in *ClusterWorkspace) DeepCopy() *ClusterWorkspace

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

func (*ClusterWorkspace) DeepCopyInto

func (in *ClusterWorkspace) DeepCopyInto(out *ClusterWorkspace)

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

func (*ClusterWorkspace) DeepCopyObject

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

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

func (*ClusterWorkspace) GetConditions

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

func (*ClusterWorkspace) SetConditions

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

type ClusterWorkspaceInitializer

type ClusterWorkspaceInitializer string

ClusterWorkspaceInitializer is a unique string corresponding to a cluster workspace initialization controller for the given type of workspaces.

type ClusterWorkspaceList

type ClusterWorkspaceList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

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

ClusterWorkspaceList is a list of ClusterWorkspace resources

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

func (*ClusterWorkspaceList) DeepCopy

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

func (*ClusterWorkspaceList) DeepCopyInto

func (in *ClusterWorkspaceList) DeepCopyInto(out *ClusterWorkspaceList)

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

func (*ClusterWorkspaceList) DeepCopyObject

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

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

type ClusterWorkspaceLocation

type ClusterWorkspaceLocation struct {
	// Current workspace placement (shard).
	//
	// +optional
	Current string `json:"current,omitempty"`

	// Target workspace placement (shard).
	//
	// +optional
	Target string `json:"target,omitempty"`

	// Historical placement details (including current and target).
	//
	// +optional
	// +listType=map
	// +listMapKey=name
	// +patchStrategy=merge
	// +patchMergeKey=name
	History []ShardStatus `json:"history,omitempty" patchStrategy:"merge" patchMergeKey:"name"`
}

ClusterWorkspaceLocation specifies workspace placement information, including current, desired (target), and historical information.

func (*ClusterWorkspaceLocation) DeepCopy

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

func (*ClusterWorkspaceLocation) DeepCopyInto

func (in *ClusterWorkspaceLocation) DeepCopyInto(out *ClusterWorkspaceLocation)

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

type ClusterWorkspacePhaseType

type ClusterWorkspacePhaseType string

ClusterWorkspacePhaseType is the type of the current phase of the workspace

const (
	ClusterWorkspacePhaseScheduling   ClusterWorkspacePhaseType = "Scheduling"
	ClusterWorkspacePhaseInitializing ClusterWorkspacePhaseType = "Initializing"
	ClusterWorkspacePhaseReady        ClusterWorkspacePhaseType = "Ready"
)

type ClusterWorkspaceSpec

type ClusterWorkspaceSpec struct {
	// +optional
	ReadOnly bool `json:"readOnly,omitempty"`

	// type defines properties of the workspace both on creation (e.g. initial
	// resources and initially installed APIs) and during runtime (e.g. permissions).
	//
	// The type is a reference to a ClusterWorkspaceType in the same workspace
	// with the same name, but lower-cased. The ClusterWorkspaceType existence is
	// validated at admission during creation, with the exception of the
	// "Universal" type whose existence is not required but respected if it exists.
	// The type is immutable after creation. The use of a type is gated via
	// the RBAC clusterworkspacetypes/use resource permission.
	//
	// +optional
	// +kubebuilder:default:="Universal"
	Type string `json:"type,omitempty"`
}

ClusterWorkspaceSpec holds the desired state of the ClusterWorkspace.

func (*ClusterWorkspaceSpec) DeepCopy

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

func (*ClusterWorkspaceSpec) DeepCopyInto

func (in *ClusterWorkspaceSpec) DeepCopyInto(out *ClusterWorkspaceSpec)

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

type ClusterWorkspaceStatus

type ClusterWorkspaceStatus struct {
	// Phase of the workspace  (Scheduling / Initializing / Ready)
	Phase ClusterWorkspacePhaseType `json:"phase,omitempty"`

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

	// Base URL where this ClusterWorkspace can be targeted.
	// This will generally be of the form: https://<workspace shard server>/cluster/<workspace name>.
	// But a workspace could also be targetable by a unique hostname in the future.
	//
	// +kubebuilder:validation:Pattern:https://[^/].*
	// +optional
	BaseURL string `json:"baseURL,omitempty"`

	// Contains workspace placement information.
	//
	// +optional
	Location ClusterWorkspaceLocation `json:"location,omitempty"`

	// initializers are set on creation by the system and must be cleared
	// by a controller before the workspace can be used. The workspace will
	// stay in the phase "Initializing" state until all initializers are cleared.
	//
	// A cluster workspace in "Initializing" state are gated via the RBAC
	// clusterworkspaces/initilize resource permission.
	//
	// +optional
	Initializers []ClusterWorkspaceInitializer `json:"initializers,omitempty"`
}

ClusterWorkspaceStatus communicates the observed state of the ClusterWorkspace.

func (*ClusterWorkspaceStatus) DeepCopy

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

func (*ClusterWorkspaceStatus) DeepCopyInto

func (in *ClusterWorkspaceStatus) DeepCopyInto(out *ClusterWorkspaceStatus)

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

type ClusterWorkspaceType

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

	// +optional
	Spec ClusterWorkspaceTypeSpec `json:"spec,omitempty"`
}

ClusterWorkspaceType specifies behaviour of workspaces of this type.

+crd +genclient +genclient:nonNamespaced +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object +kubebuilder:resource:scope=Cluster,categories=kcp

func (*ClusterWorkspaceType) DeepCopy

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

func (*ClusterWorkspaceType) DeepCopyInto

func (in *ClusterWorkspaceType) DeepCopyInto(out *ClusterWorkspaceType)

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

func (*ClusterWorkspaceType) DeepCopyObject

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

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

type ClusterWorkspaceTypeList

type ClusterWorkspaceTypeList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

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

ClusterWorkspaceTypeList is a list of cluster workspace types

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

func (*ClusterWorkspaceTypeList) DeepCopy

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

func (*ClusterWorkspaceTypeList) DeepCopyInto

func (in *ClusterWorkspaceTypeList) DeepCopyInto(out *ClusterWorkspaceTypeList)

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

func (*ClusterWorkspaceTypeList) DeepCopyObject

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

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

type ClusterWorkspaceTypeSpec

type ClusterWorkspaceTypeSpec struct {
	// initializers are set of a ClusterWorkspace on creation and must be
	// cleared by a controller before the workspace can be used. The workspace
	// will stay in the phase "Initializing" state until all initializers are cleared.
	//
	// +optional
	Initializers []ClusterWorkspaceInitializer `json:"initializers,omitempty"`

	// additionalWorkspaceLabels are a set of labels that will be added to a
	// ClusterWorkspace on creation.
	//
	// +optional
	AdditionalWorkspaceLabels map[string]string `json:"additionalWorkspaceLabels,omitempty"`
}

func (*ClusterWorkspaceTypeSpec) DeepCopy

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

func (*ClusterWorkspaceTypeSpec) DeepCopyInto

func (in *ClusterWorkspaceTypeSpec) DeepCopyInto(out *ClusterWorkspaceTypeSpec)

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

type ConnectionInfo

type ConnectionInfo struct {
	// Host must be a host string, a host:port pair, or a URL to the base of the apiserver.
	// If a URL is given then the (optional) Path of that URL represents a prefix that must
	// be appended to all request URIs used to access the apiserver. This allows a frontend
	// proxy to easily relocate all of the apiserver endpoints.
	// +kubebuilder:validation:Format=uri
	Host string `json:"host"`
	// APIPath is a sub-path that points to an API root.
	APIPath string `json:"apiPath"`
}

ConnectionInfo holds the information necessary to connect to a shard.

func (*ConnectionInfo) DeepCopy

func (in *ConnectionInfo) DeepCopy() *ConnectionInfo

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

func (*ConnectionInfo) DeepCopyInto

func (in *ConnectionInfo) DeepCopyInto(out *ConnectionInfo)

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

type ShardStatus

type ShardStatus struct {
	// Name of an active WorkspaceShard.
	//
	// +kubebuilder:validation:MinLength=1
	Name string `json:"name"`

	// Resource version at which writes to this shard should not be accepted.
	LiveBeforeResourceVersion string `json:"liveBeforeResourceVersion,omitempty"`

	// Resource version after which writes can be accepted on this shard.
	LiveAfterResourceVersion string `json:"liveAfterResourceVersion,omitempty"`
}

ShardStatus contains details for the current status of a workspace 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.

type WorkspaceShard

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

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

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

WorkspaceShard describes a Shard (== KCP instance) on which a number of workspaces 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

func (*WorkspaceShard) DeepCopy

func (in *WorkspaceShard) DeepCopy() *WorkspaceShard

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

func (*WorkspaceShard) DeepCopyInto

func (in *WorkspaceShard) DeepCopyInto(out *WorkspaceShard)

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

func (*WorkspaceShard) DeepCopyObject

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

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

func (*WorkspaceShard) GetConditions

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

func (*WorkspaceShard) SetConditions

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

type WorkspaceShardList

type WorkspaceShardList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata"`

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

WorkspaceShardList is a list of workspace shards

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

func (*WorkspaceShardList) DeepCopy

func (in *WorkspaceShardList) DeepCopy() *WorkspaceShardList

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

func (*WorkspaceShardList) DeepCopyInto

func (in *WorkspaceShardList) DeepCopyInto(out *WorkspaceShardList)

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

func (*WorkspaceShardList) DeepCopyObject

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

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

type WorkspaceShardSpec

type WorkspaceShardSpec struct {
	// Credentials is a reference to the administrative credentials for this shard.
	Credentials corev1.SecretReference `json:"credentials"`
}

WorkspaceShardSpec holds the desired state of the WorkspaceShard.

func (*WorkspaceShardSpec) DeepCopy

func (in *WorkspaceShardSpec) DeepCopy() *WorkspaceShardSpec

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

func (*WorkspaceShardSpec) DeepCopyInto

func (in *WorkspaceShardSpec) DeepCopyInto(out *WorkspaceShardSpec)

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

type WorkspaceShardStatus

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

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

	// Connection information for the WorkspaceShard.
	// +optional
	ConnectionInfo *ConnectionInfo `json:"connectionInfo,omitempty"`

	// Version of credentials last successfully loaded.
	// +optional
	CredentialsHash string `json:"credentialsHash,omitempty"`
}

WorkspaceShardStatus communicates the observed state of the WorkspaceShard.

func (*WorkspaceShardStatus) DeepCopy

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

func (*WorkspaceShardStatus) DeepCopyInto

func (in *WorkspaceShardStatus) DeepCopyInto(out *WorkspaceShardStatus)

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