v1alpha1

package
v0.5.0-alpha.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 License: Apache-2.0 Imports: 4 Imported by: 15

Documentation

Overview

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

Index

Constants

View Source
const (
	// LocationLabelsStringAnnotationKey is the label key for the label holding a string
	// representation of the location labels in order to use them in a table column in the CLI.
	LocationLabelsStringAnnotationKey = "scheduling.kcp.dev/labels"

	// PlacementAnnotationKey is the label key for the label holding a PlacementAnnotation struct.
	PlacementAnnotationKey = "scheduling.kcp.dev/placement"

	// InternalNegotiationWorkspaceAnnotationKey is the label key storing the negotiation workspace.
	InternalNegotiationWorkspaceAnnotationKey = "internal.scheduling.kcp.dev/negotiation-workspace"
)

Variables

View Source
var (
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	AddToScheme   = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: scheduling.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 AvailableSelectorLabel

type AvailableSelectorLabel struct {
	// key is the name of the label.
	//
	// +required
	// +kubebuilder:Required
	Key LabelKey `json:"key"`

	// values are the possible values for this labels.
	//
	// +kubebuilder:validation:MinItems=1
	// +required
	// +kubebuilder:Required
	// +listType=set
	Values []LabelValue `json:"values"`

	// description is a human readable description of the label.
	//
	// +optional
	Description string `json:"description,omitempty"`
}

AvailableSelectorLabel specifies a label with key name and possible values.

func (*AvailableSelectorLabel) DeepCopy

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

func (*AvailableSelectorLabel) DeepCopyInto

func (in *AvailableSelectorLabel) DeepCopyInto(out *AvailableSelectorLabel)

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

type GroupVersionResource

type GroupVersionResource struct {
	// group is the name of an API group.
	//
	// +kubebuilder:validation:Pattern=`^(|[a-z0-9]([-a-z0-9]*[a-z0-9](\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?)$`
	// +kubebuilder:validation:Enum="workload.kcp.dev"
	// +optional
	Group string `json:"group,omitempty"`

	// version is the version of the API.
	//
	// +kubebuilder:validation:Pattern=`^[a-z][-a-z0-9]*[a-z0-9]$`
	// +kubebuilder:validation:MinLength:1
	// +kubebuilder:validation:Enum="v1alpha1"
	// +required
	// +kubebuilder:Required
	Version string `json:"version"`

	// resource is the name of the resource.
	// +kubebuilder:validation:Pattern=`^[a-z][-a-z0-9]*[a-z0-9]$`
	// +kubebuilder:validation:MinLength:1
	// +kubebuilder:validation:Enum="workloadclusters"
	// +required
	// +kubebuilder:Required
	Resource string `json:"resource"`
}

GroupVersionResource unambiguously identifies a resource.

func (*GroupVersionResource) DeepCopy

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

func (*GroupVersionResource) DeepCopyInto

func (in *GroupVersionResource) DeepCopyInto(out *GroupVersionResource)

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

type LabelKey

type LabelKey string

LabelKey is a key for a label.

+kubebuilder:validation:Pattern=`^([a-z0-9]([-a-z0-9]*[a-z0-9](\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?/)?([a-zA-Z0-9][-a-zA-Z0-9_.]{0,61})?[a-zA-Z0-9]$` +kubebuilder:validation:MaxLength=255

type LabelValue

type LabelValue string

LabelValue specifies a value of a label.

+kubebuilder:validation:Pattern=`^(|([a-z0-9]([-a-z0-9]*[a-z0-9](\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)?/)?([a-zA-Z0-9][-a-zA-Z0-9_.]{0,61})?[a-zA-Z0-9])$` +kubebuilder:validation:MaxLength=63

type Location

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

	Spec LocationSpec `json:"spec,omitempty"`

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

Location represents a set of instances of a scheduling resource type acting a target of scheduling.

The location is chosen by the user (in the future) through a Placement object, while the instance is chosen by the scheduler depending on considerations like load or available resources, or further node selectors specified by the user.

+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="Resource",type=string,JSONPath=`.spec.resource.resource`,description="Type of the workspace" +kubebuilder:printcolumn:name="Available",type=string,JSONPath=`.status.availableInstances`,description="Available instances in this location" +kubebuilder:printcolumn:name="Instances",type=string,JSONPath=`.status.instances`,description="Instances in this location" +kubebuilder:printcolumn:name="Labels",type=string,JSONPath=`.metadata.annotation."scheduling.kcp.dev/labels"`,description="The common labels of this location"

func (*Location) DeepCopy

func (in *Location) DeepCopy() *Location

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

func (*Location) DeepCopyInto

func (in *Location) DeepCopyInto(out *Location)

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

func (*Location) DeepCopyObject

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

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

type LocationList

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

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

LocationList is a list of locations.

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

func (*LocationList) DeepCopy

func (in *LocationList) DeepCopy() *LocationList

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

func (*LocationList) DeepCopyInto

func (in *LocationList) DeepCopyInto(out *LocationList)

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

func (*LocationList) DeepCopyObject

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

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

type LocationSpec

type LocationSpec struct {
	// resource is the group-version-resource of the instances that are subject to this location.
	//
	// +required
	// +kubebuilder:Required
	Resource GroupVersionResource `json:"resource"`

	// description is a human-readable description of the location.
	//
	// +optional
	Description string `json:"description,omitempty"`

	// availableSelectorLabels is a list of labels that can be used to select an
	// instance at this location in a placement object.
	//
	// +listType=map
	// +listMapKey=key
	AvailableSelectorLabels []AvailableSelectorLabel `json:"availableSelectorLabels,omitempty"`

	// instanceSelector chooses the instances that will be part of this location.
	//
	// Note that these labels are not what is shown in the Location objects to
	// the user. Depending on context, both will match or won't match.
	//
	// +optional
	InstanceSelector *metav1.LabelSelector `json:"instanceSelector,omitempty"`
}

LocationSpec holds the desired state of the Location.

func (*LocationSpec) DeepCopy

func (in *LocationSpec) DeepCopy() *LocationSpec

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

func (*LocationSpec) DeepCopyInto

func (in *LocationSpec) DeepCopyInto(out *LocationSpec)

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

type LocationStatus

type LocationStatus struct {
	// instances is the number of actual instances at this location.
	Instances *uint32 `json:"instances,omitempty"`

	// available is the number of actual instances that are available at this location.
	AvailableInstances *uint32 `json:"availableInstances,omitempty"`
}

LocationStatus defines the observed state of Location.

func (*LocationStatus) DeepCopy

func (in *LocationStatus) DeepCopy() *LocationStatus

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

func (*LocationStatus) DeepCopyInto

func (in *LocationStatus) DeepCopyInto(out *LocationStatus)

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

type PlacementAnnotation

type PlacementAnnotation map[string]PlacementState

PlacementAnnotation is the type marshalled into the PlacementAnnotationKey annotation on namespaces. The keys are strings identifying a workload cluster the namespace is placed on.

func (PlacementAnnotation) DeepCopy

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

func (PlacementAnnotation) DeepCopyInto

func (in PlacementAnnotation) DeepCopyInto(out *PlacementAnnotation)

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

type PlacementState

type PlacementState string

PlacementState is the state of a namespace placement state machine.

const (
	// PlacementStatePending means that the namespace is being adopted by the workload cluster.
	PlacementStatePending PlacementState = "Pending"
	// PlacementStateBound means that the namespace is adopted by the workload cluster.
	PlacementStateBound PlacementState = "Bound"
	// PlacementStateRemoving means that the namespace is being removed by the workload cluster.
	PlacementStateRemoving PlacementState = "Removing"
	// PlacementStateUnbound means that the namespace is removed and hence unbound from the workload cluster.
	PlacementStateUnbound PlacementState = "Unbound"
)

Jump to

Keyboard shortcuts

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