v1beta1

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2023 License: Apache-2.0 Imports: 9 Imported by: 89

Documentation

Overview

+kubebuilder:validation:Optional +groupName=cluster.open-cluster-management.io

Index

Constants

View Source
const (
	// Valid ScoreCoordinate type is BuiltIn, AddOn.
	ScoreCoordinateTypeBuiltIn string = "BuiltIn"
	ScoreCoordinateTypeAddOn   string = "AddOn"
)
View Source
const (
	// PlacementConditionSatisfied means Placement requirements are satisfied.
	// A placement is not satisfied only if there is empty ClusterDecision in the status.decisions
	// of PlacementDecisions.
	PlacementConditionSatisfied string = "PlacementSatisfied"
	// PlacementConditionMisconfigured means Placement configuration is incorrect.
	PlacementConditionMisconfigured string = "PlacementMisconfigured"
)
View Source
const (
	// ClusterSetBindingBoundType is a condition type of clustersetbinding representing
	// whether the ClusterSetBinding is bound to a clusterset.
	ClusterSetBindingBoundType = "Bound"
)
View Source
const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset"

LegacyClusterSetLabel LabelKey

View Source
const (
	// ManagedClusterSetConditionEmpty means no ManagedCluster is included in the
	// ManagedClusterSet.
	ManagedClusterSetConditionEmpty string = "ClusterSetEmpty"
)
View Source
const (
	// PlacementDisableAnnotation is used to disable scheduling for a placement.
	// It is a experimental flag to let placement controller ignore this placement,
	// so other placement consumers can chime in.
	PlacementDisableAnnotation = "cluster.open-cluster-management.io/experimental-scheduling-disable"
)
View Source
const (
	PlacementLabel string = "cluster.open-cluster-management.io/placement"
)

The placementDecsion label name holding the placement name

Variables

View Source
var (
	GroupName    = "cluster.open-cluster-management.io"
	GroupVersion = schema.GroupVersion{Group: GroupName, Version: "v1beta1"}

	// Install is a function which adds this version to a scheme
	Install = schemeBuilder.AddToScheme

	// SchemeGroupVersion generated code relies on this name
	// Deprecated
	SchemeGroupVersion = GroupVersion
	// AddToScheme exists solely to keep the old generators creating valid code
	// DEPRECATED
	AddToScheme = schemeBuilder.AddToScheme
)

Functions

func BuildClusterSelector added in v0.8.0

func BuildClusterSelector(clusterSet *ManagedClusterSet) (labels.Selector, error)

func GetClustersFromClusterSet added in v0.8.0

func GetClustersFromClusterSet(clusterSet *ManagedClusterSet,
	clustersGetter ManagedClustersGetter) ([]*v1.ManagedCluster, error)

GetClustersFromClusterSet return the ManagedClusterSet's managedClusters

func Resource

func Resource(resource string) schema.GroupResource

Resource generated code relies on this being here, but it logically belongs to the group DEPRECATED

Types

type AddOnScore added in v0.7.0

type AddOnScore struct {
	// ResourceName defines the resource name of the AddOnPlacementScore.
	// The placement prioritizer selects AddOnPlacementScore CR by this name.
	// +kubebuilder:validation:Required
	// +required
	ResourceName string `json:"resourceName"`

	// ScoreName defines the score name inside AddOnPlacementScore.
	// AddOnPlacementScore contains a list of score name and score value, ScoreName specify the score to be used by
	// the prioritizer.
	// +kubebuilder:validation:Required
	// +required
	ScoreName string `json:"scoreName"`
}

AddOnScore represents the configuration of the addon score source.

func (*AddOnScore) DeepCopy added in v0.7.0

func (in *AddOnScore) DeepCopy() *AddOnScore

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

func (*AddOnScore) DeepCopyInto added in v0.7.0

func (in *AddOnScore) DeepCopyInto(out *AddOnScore)

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

func (AddOnScore) SwaggerDoc added in v0.7.0

func (AddOnScore) SwaggerDoc() map[string]string

type ClusterClaimSelector added in v0.7.0

type ClusterClaimSelector struct {
	// matchExpressions is a list of cluster claim selector requirements. The requirements are ANDed.
	// +optional
	MatchExpressions []metav1.LabelSelectorRequirement `json:"matchExpressions,omitempty"`
}

ClusterClaimSelector is a claim query over a set of ManagedClusters. An empty cluster claim selector matches all objects. A null cluster claim selector matches no objects.

func (*ClusterClaimSelector) DeepCopy added in v0.7.0

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

func (*ClusterClaimSelector) DeepCopyInto added in v0.7.0

func (in *ClusterClaimSelector) DeepCopyInto(out *ClusterClaimSelector)

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

func (ClusterClaimSelector) SwaggerDoc added in v0.7.0

func (ClusterClaimSelector) SwaggerDoc() map[string]string

type ClusterDecision added in v0.7.0

type ClusterDecision struct {
	// ClusterName is the name of the ManagedCluster. If it is not empty, its value should be unique cross all
	// placement decisions for the Placement.
	// +kubebuilder:validation:Required
	// +required
	ClusterName string `json:"clusterName"`

	// Reason represents the reason why the ManagedCluster is selected.
	// +kubebuilder:validation:Required
	// +required
	Reason string `json:"reason"`
}

ClusterDecision represents a decision from a placement An empty ClusterDecision indicates it is not scheduled yet.

func (*ClusterDecision) DeepCopy added in v0.7.0

func (in *ClusterDecision) DeepCopy() *ClusterDecision

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

func (*ClusterDecision) DeepCopyInto added in v0.7.0

func (in *ClusterDecision) DeepCopyInto(out *ClusterDecision)

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

func (ClusterDecision) SwaggerDoc added in v0.7.0

func (ClusterDecision) SwaggerDoc() map[string]string

type ClusterPredicate added in v0.7.0

type ClusterPredicate struct {
	// RequiredClusterSelector represents a selector of ManagedClusters by label and claim. If specified,
	// 1) Any ManagedCluster, which does not match the selector, should not be selected by this ClusterPredicate;
	// 2) If a selected ManagedCluster (of this ClusterPredicate) ceases to match the selector (e.g. due to
	//    an update) of any ClusterPredicate, it will be eventually removed from the placement decisions;
	// 3) If a ManagedCluster (not selected previously) starts to match the selector, it will either
	//    be selected or at least has a chance to be selected (when NumberOfClusters is specified);
	// +optional
	RequiredClusterSelector ClusterSelector `json:"requiredClusterSelector,omitempty"`
}

ClusterPredicate represents a predicate to select ManagedClusters.

func (*ClusterPredicate) DeepCopy added in v0.7.0

func (in *ClusterPredicate) DeepCopy() *ClusterPredicate

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

func (*ClusterPredicate) DeepCopyInto added in v0.7.0

func (in *ClusterPredicate) DeepCopyInto(out *ClusterPredicate)

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

func (ClusterPredicate) SwaggerDoc added in v0.7.0

func (ClusterPredicate) SwaggerDoc() map[string]string

type ClusterSelector added in v0.7.0

type ClusterSelector struct {
	// LabelSelector represents a selector of ManagedClusters by label
	// +optional
	LabelSelector metav1.LabelSelector `json:"labelSelector,omitempty"`

	// ClaimSelector represents a selector of ManagedClusters by clusterClaims in status
	// +optional
	ClaimSelector ClusterClaimSelector `json:"claimSelector,omitempty"`
}

ClusterSelector represents the AND of the containing selectors. An empty cluster selector matches all objects. A null cluster selector matches no objects.

func (*ClusterSelector) DeepCopy added in v0.7.0

func (in *ClusterSelector) DeepCopy() *ClusterSelector

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

func (*ClusterSelector) DeepCopyInto added in v0.7.0

func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector)

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

func (ClusterSelector) SwaggerDoc added in v0.7.0

func (ClusterSelector) SwaggerDoc() map[string]string

type ManagedClusterSelector added in v0.7.0

type ManagedClusterSelector struct {
	// SelectorType could only be "LegacyClusterSetLabel" or "LabelSelector"
	// "LegacyClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:<ManagedClusterSet Name>"" to select target clusters.
	// "LabelSelector" means use labelSelector to select target managedClusters
	// +kubebuilder:validation:Enum=LegacyClusterSetLabel;LabelSelector
	// +kubebuilder:default:=LegacyClusterSetLabel
	// +required
	SelectorType SelectorType `json:"selectorType,omitempty"`

	// LabelSelector define the general labelSelector which clusterset will use to select target managedClusters
	// +optional
	LabelSelector *metav1.LabelSelector `json:"labelSelector,omitempty"`
}

ManagedClusterSelector represents a selector of ManagedClusters

func (*ManagedClusterSelector) DeepCopy added in v0.7.0

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

func (*ManagedClusterSelector) DeepCopyInto added in v0.7.0

func (in *ManagedClusterSelector) DeepCopyInto(out *ManagedClusterSelector)

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

func (ManagedClusterSelector) SwaggerDoc added in v0.7.0

func (ManagedClusterSelector) SwaggerDoc() map[string]string

type ManagedClusterSet

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

	// Spec defines the attributes of the ManagedClusterSet
	// +kubebuilder:default={clusterSelector: {selectorType: LegacyClusterSetLabel}}
	Spec ManagedClusterSetSpec `json:"spec"`

	// Status represents the current status of the ManagedClusterSet
	// +optional
	Status ManagedClusterSetStatus `json:"status,omitempty"`
}

ManagedClusterSet defines a group of ManagedClusters that user's workload can run on. A workload can be defined to deployed on a ManagedClusterSet, which mean:

  1. The workload can run on any ManagedCluster in the ManagedClusterSet
  2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet
  3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet

In order to assign a ManagedCluster to a certian ManagedClusterSet, add a label with name `cluster.open-cluster-management.io/clusterset` on the ManagedCluster to refers to the ManagedClusterSet. User is not allow to add/remove this label on a ManagedCluster unless they have a RBAC rule to CREATE on a virtual subresource of managedclustersets/join. In order to update this label, user must have the permission on both the old and new ManagedClusterSet.

func GetClusterSetsOfCluster added in v0.8.0

func GetClusterSetsOfCluster(cluster *v1.ManagedCluster,
	clusterSetsGetter ManagedClusterSetsGetter) ([]*ManagedClusterSet, error)

GetClusterSetsOfClusterByCluster return the managedClusterSets of a managedCluster

func (*ManagedClusterSet) DeepCopy

func (in *ManagedClusterSet) DeepCopy() *ManagedClusterSet

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

func (*ManagedClusterSet) DeepCopyInto

func (in *ManagedClusterSet) DeepCopyInto(out *ManagedClusterSet)

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

func (*ManagedClusterSet) DeepCopyObject

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

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

func (ManagedClusterSet) SwaggerDoc

func (ManagedClusterSet) SwaggerDoc() map[string]string

type ManagedClusterSetBinding

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

	// Spec defines the attributes of ManagedClusterSetBinding.
	Spec ManagedClusterSetBindingSpec `json:"spec"`

	// Status represents the current status of the ManagedClusterSetBinding
	// +optional
	Status ManagedClusterSetBindingStatus `json:"status,omitempty"`
}

ManagedClusterSetBinding projects a ManagedClusterSet into a certain namespace. User is able to create a ManagedClusterSetBinding in a namespace and bind it to a ManagedClusterSet if they have an RBAC rule to CREATE on the virtual subresource of managedclustersets/bind. Workloads created in the same namespace can only be distributed to ManagedClusters in ManagedClusterSets bound in this namespace by higher level controllers.

func GetBoundManagedClusterSetBindings added in v0.8.0

func GetBoundManagedClusterSetBindings(namespace string,
	clusterSetBindingsGetter ManagedClusterSetBindingsGetter) ([]*ManagedClusterSetBinding, error)

GetBoundManagedClusterSetBindings returns all bindings that are bounded to clustersets in the given namespace.

func (*ManagedClusterSetBinding) DeepCopy

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

func (*ManagedClusterSetBinding) DeepCopyInto

func (in *ManagedClusterSetBinding) DeepCopyInto(out *ManagedClusterSetBinding)

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

func (*ManagedClusterSetBinding) DeepCopyObject

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

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

func (ManagedClusterSetBinding) SwaggerDoc

func (ManagedClusterSetBinding) SwaggerDoc() map[string]string

type ManagedClusterSetBindingList

type ManagedClusterSetBindingList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of ManagedClusterSetBinding.
	Items []ManagedClusterSetBinding `json:"items"`
}

ManagedClusterSetBindingList is a collection of ManagedClusterSetBinding.

func (*ManagedClusterSetBindingList) DeepCopy

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

func (*ManagedClusterSetBindingList) DeepCopyInto

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

func (*ManagedClusterSetBindingList) DeepCopyObject

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

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

func (ManagedClusterSetBindingList) SwaggerDoc

func (ManagedClusterSetBindingList) SwaggerDoc() map[string]string

type ManagedClusterSetBindingSpec

type ManagedClusterSetBindingSpec struct {
	// ClusterSet is the name of the ManagedClusterSet to bind. It must match the
	// instance name of the ManagedClusterSetBinding and cannot change once created.
	// User is allowed to set this field if they have an RBAC rule to CREATE on the
	// virtual subresource of managedclustersets/bind.
	// +kubebuilder:validation:MinLength=1
	ClusterSet string `json:"clusterSet"`
}

ManagedClusterSetBindingSpec defines the attributes of ManagedClusterSetBinding.

func (*ManagedClusterSetBindingSpec) DeepCopy

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

func (*ManagedClusterSetBindingSpec) DeepCopyInto

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

func (ManagedClusterSetBindingSpec) SwaggerDoc

func (ManagedClusterSetBindingSpec) SwaggerDoc() map[string]string

type ManagedClusterSetBindingStatus added in v0.8.0

type ManagedClusterSetBindingStatus struct {
	// Conditions contains the different condition statuses for this ManagedClusterSetBinding.
	Conditions []metav1.Condition `json:"conditions"`
}

ManagedClusterSetBindingStatus represents the current status of the ManagedClusterSetBinding.

func (*ManagedClusterSetBindingStatus) DeepCopy added in v0.8.0

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

func (*ManagedClusterSetBindingStatus) DeepCopyInto added in v0.8.0

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

func (ManagedClusterSetBindingStatus) SwaggerDoc added in v0.8.0

func (ManagedClusterSetBindingStatus) SwaggerDoc() map[string]string

type ManagedClusterSetBindingsGetter added in v0.8.0

type ManagedClusterSetBindingsGetter interface {
	List(namespace string, selector labels.Selector) (ret []*ManagedClusterSetBinding, err error)
}

type ManagedClusterSetList

type ManagedClusterSetList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of ManagedClusterSet.
	Items []ManagedClusterSet `json:"items"`
}

ManagedClusterSetList is a collection of ManagedClusterSet.

func (*ManagedClusterSetList) DeepCopy

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

func (*ManagedClusterSetList) DeepCopyInto

func (in *ManagedClusterSetList) DeepCopyInto(out *ManagedClusterSetList)

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

func (*ManagedClusterSetList) DeepCopyObject

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

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

func (ManagedClusterSetList) SwaggerDoc

func (ManagedClusterSetList) SwaggerDoc() map[string]string

type ManagedClusterSetSpec

type ManagedClusterSetSpec struct {
	// ClusterSelector represents a selector of ManagedClusters
	// +optional
	// +kubebuilder:default:={selectorType: LegacyClusterSetLabel}
	ClusterSelector ManagedClusterSelector `json:"clusterSelector,omitempty"`
}

ManagedClusterSetSpec describes the attributes of the ManagedClusterSet

func (*ManagedClusterSetSpec) DeepCopy

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

func (*ManagedClusterSetSpec) DeepCopyInto

func (in *ManagedClusterSetSpec) DeepCopyInto(out *ManagedClusterSetSpec)

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

func (ManagedClusterSetSpec) SwaggerDoc

func (ManagedClusterSetSpec) SwaggerDoc() map[string]string

type ManagedClusterSetStatus

type ManagedClusterSetStatus struct {
	// Conditions contains the different condition statuses for this ManagedClusterSet.
	Conditions []metav1.Condition `json:"conditions"`
}

ManagedClusterSetStatus represents the current status of the ManagedClusterSet.

func (*ManagedClusterSetStatus) DeepCopy

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

func (*ManagedClusterSetStatus) DeepCopyInto

func (in *ManagedClusterSetStatus) DeepCopyInto(out *ManagedClusterSetStatus)

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

func (ManagedClusterSetStatus) SwaggerDoc

func (ManagedClusterSetStatus) SwaggerDoc() map[string]string

type ManagedClusterSetsGetter added in v0.8.0

type ManagedClusterSetsGetter interface {
	List(selector labels.Selector) (ret []*ManagedClusterSet, err error)
}

type ManagedClustersGetter added in v0.8.0

type ManagedClustersGetter interface {
	List(selector labels.Selector) (ret []*v1.ManagedCluster, err error)
}

type Placement added in v0.7.0

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

	// Spec defines the attributes of Placement.
	// +kubebuilder:validation:Required
	// +required
	Spec PlacementSpec `json:"spec"`

	// Status represents the current status of the Placement
	// +optional
	Status PlacementStatus `json:"status,omitempty"`
}

Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace.

Here is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters:

  1. Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters;
  2. ManagedClusters are organized into cluster-scoped ManagedClusterSets;
  3. ManagedClusterSets are bound to workload namespaces;
  4. Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set of potential ManagedClusters;
  5. Then Placements subselect from that working set using label/claim selection.

No ManagedCluster will be selected if no ManagedClusterSet is bound to the placement namespace. User is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have a RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`.

A slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement.

If a ManagedCluster is selected and added into the PlacementDecisions, other components may apply workload on it; once it is removed from the PlacementDecisions, the workload applied on this ManagedCluster should be evicted accordingly.

func (*Placement) DeepCopy added in v0.7.0

func (in *Placement) DeepCopy() *Placement

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

func (*Placement) DeepCopyInto added in v0.7.0

func (in *Placement) DeepCopyInto(out *Placement)

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

func (*Placement) DeepCopyObject added in v0.7.0

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

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

func (Placement) SwaggerDoc added in v0.7.0

func (Placement) SwaggerDoc() map[string]string

type PlacementDecision added in v0.7.0

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

	// Status represents the current status of the PlacementDecision
	// +optional
	Status PlacementDecisionStatus `json:"status,omitempty"`
}

PlacementDecision indicates a decision from a placement PlacementDecision should has a label cluster.open-cluster-management.io/placement={placement name} to reference a certain placement.

If a placement has spec.numberOfClusters specified, the total number of decisions contained in status.decisions of PlacementDecisions should always be NumberOfClusters; otherwise, the total number of decisions should be the number of ManagedClusters which match the placement requirements.

Some of the decisions might be empty when there are no enough ManagedClusters meet the placement requirements.

func (*PlacementDecision) DeepCopy added in v0.7.0

func (in *PlacementDecision) DeepCopy() *PlacementDecision

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

func (*PlacementDecision) DeepCopyInto added in v0.7.0

func (in *PlacementDecision) DeepCopyInto(out *PlacementDecision)

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

func (*PlacementDecision) DeepCopyObject added in v0.7.0

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

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

func (PlacementDecision) SwaggerDoc added in v0.7.0

func (PlacementDecision) SwaggerDoc() map[string]string

type PlacementDecisionClustersTracker added in v0.8.0

type PlacementDecisionClustersTracker struct {
	// contains filtered or unexported fields
}

+k8s:deepcopy-gen=false

func NewPlacementDecisionClustersTracker added in v0.8.0

func NewPlacementDecisionClustersTracker(placement *Placement, pdl PlacementDecisionGetter, existingScheduledClusters sets.String) *PlacementDecisionClustersTracker

func (*PlacementDecisionClustersTracker) Existing added in v0.8.0

func (pdct *PlacementDecisionClustersTracker) Existing() sets.String

Existing() returns the tracker's existing decision cluster names.

func (*PlacementDecisionClustersTracker) Get added in v0.8.0

Get() update the tracker's decisionClusters and return the added and deleted cluster names.

type PlacementDecisionGetter added in v0.8.0

type PlacementDecisionGetter interface {
	List(selector labels.Selector, namespace string) (ret []*PlacementDecision, err error)
}

type PlacementDecisionList added in v0.7.0

type PlacementDecisionList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of PlacementDecision.
	Items []PlacementDecision `json:"items"`
}

ClusterDecisionList is a collection of PlacementDecision.

func (*PlacementDecisionList) DeepCopy added in v0.7.0

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

func (*PlacementDecisionList) DeepCopyInto added in v0.7.0

func (in *PlacementDecisionList) DeepCopyInto(out *PlacementDecisionList)

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

func (*PlacementDecisionList) DeepCopyObject added in v0.7.0

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

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

func (PlacementDecisionList) SwaggerDoc added in v0.7.0

func (PlacementDecisionList) SwaggerDoc() map[string]string

type PlacementDecisionStatus added in v0.7.0

type PlacementDecisionStatus struct {
	// Decisions is a slice of decisions according to a placement
	// The number of decisions should not be larger than 100
	// +kubebuilder:validation:Required
	// +required
	Decisions []ClusterDecision `json:"decisions"`
}

PlacementDecisionStatus represents the current status of the PlacementDecision.

func (*PlacementDecisionStatus) DeepCopy added in v0.7.0

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

func (*PlacementDecisionStatus) DeepCopyInto added in v0.7.0

func (in *PlacementDecisionStatus) DeepCopyInto(out *PlacementDecisionStatus)

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

func (PlacementDecisionStatus) SwaggerDoc added in v0.7.0

func (PlacementDecisionStatus) SwaggerDoc() map[string]string

type PlacementList added in v0.7.0

type PlacementList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard list metadata.
	// More info: https://git.k8s.io/community/contributors/devel/api-conventions.md#types-kinds
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of Placements.
	Items []Placement `json:"items"`
}

PlacementList is a collection of Placements.

func (*PlacementList) DeepCopy added in v0.7.0

func (in *PlacementList) DeepCopy() *PlacementList

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

func (*PlacementList) DeepCopyInto added in v0.7.0

func (in *PlacementList) DeepCopyInto(out *PlacementList)

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

func (*PlacementList) DeepCopyObject added in v0.7.0

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

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

func (PlacementList) SwaggerDoc added in v0.7.0

func (PlacementList) SwaggerDoc() map[string]string

type PlacementSpec added in v0.7.0

type PlacementSpec struct {
	// ClusterSets represent the ManagedClusterSets from which the ManagedClusters are selected.
	// If the slice is empty, ManagedClusters will be selected from the ManagedClusterSets bound to the placement
	// namespace, otherwise ManagedClusters will be selected from the intersection of this slice and the
	// ManagedClusterSets bound to the placement namespace.
	// +optional
	ClusterSets []string `json:"clusterSets,omitempty"`

	// NumberOfClusters represents the desired number of ManagedClusters to be selected which meet the
	// placement requirements.
	// 1) If not specified, all ManagedClusters which meet the placement requirements (including ClusterSets,
	//    and Predicates) will be selected;
	// 2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than
	//    NumberOfClusters, a random subset with desired number of ManagedClusters will be selected;
	// 3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters,
	//    all of them will be selected;
	// 4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters,
	//    all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be
	//    set to false;
	// +optional
	NumberOfClusters *int32 `json:"numberOfClusters,omitempty"`

	// Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed.
	// +optional
	Predicates []ClusterPredicate `json:"predicates,omitempty"`

	// PrioritizerPolicy defines the policy of the prioritizers.
	// If this field is unset, then default prioritizer mode and configurations are used.
	// Referring to PrioritizerPolicy to see more description about Mode and Configurations.
	// +optional
	PrioritizerPolicy PrioritizerPolicy `json:"prioritizerPolicy"`

	// SpreadPolicy defines how placement decisions should be distributed among a
	// set of ManagedClusters.
	// +optional
	SpreadPolicy SpreadPolicy `json:"spreadPolicy,omitempty"`

	// Tolerations are applied to placements, and allow (but do not require) the managed clusters with
	// certain taints to be selected by placements with matching tolerations.
	// +optional
	Tolerations []Toleration `json:"tolerations,omitempty"`
}

PlacementSpec defines the attributes of Placement. An empty PlacementSpec selects all ManagedClusters from the ManagedClusterSets bound to the placement namespace. The containing fields are ANDed.

func (*PlacementSpec) DeepCopy added in v0.7.0

func (in *PlacementSpec) DeepCopy() *PlacementSpec

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

func (*PlacementSpec) DeepCopyInto added in v0.7.0

func (in *PlacementSpec) DeepCopyInto(out *PlacementSpec)

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

func (PlacementSpec) SwaggerDoc added in v0.7.0

func (PlacementSpec) SwaggerDoc() map[string]string

type PlacementStatus added in v0.7.0

type PlacementStatus struct {
	// NumberOfSelectedClusters represents the number of selected ManagedClusters
	// +optional
	NumberOfSelectedClusters int32 `json:"numberOfSelectedClusters"`

	// Conditions contains the different condition status for this Placement.
	// +optional
	Conditions []metav1.Condition `json:"conditions"`
}

func (*PlacementStatus) DeepCopy added in v0.7.0

func (in *PlacementStatus) DeepCopy() *PlacementStatus

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

func (*PlacementStatus) DeepCopyInto added in v0.7.0

func (in *PlacementStatus) DeepCopyInto(out *PlacementStatus)

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

func (PlacementStatus) SwaggerDoc added in v0.7.0

func (PlacementStatus) SwaggerDoc() map[string]string

type PrioritizerConfig added in v0.7.0

type PrioritizerConfig struct {
	// ScoreCoordinate represents the configuration of the prioritizer and score source.
	// +kubebuilder:validation:Required
	// +required
	ScoreCoordinate *ScoreCoordinate `json:"scoreCoordinate,omitempty"`

	// Weight defines the weight of the prioritizer score. The value must be ranged in [-10,10].
	// Each prioritizer will calculate an integer score of a cluster in the range of [-100, 100].
	// The final score of a cluster will be sum(weight * prioritizer_score).
	// A higher weight indicates that the prioritizer weights more in the cluster selection,
	// while 0 weight indicates that the prioritizer is disabled. A negative weight indicates
	// wants to select the last ones.
	// +kubebuilder:validation:Minimum:=-10
	// +kubebuilder:validation:Maximum:=10
	// +kubebuilder:default:=1
	// +optional
	Weight int32 `json:"weight,omitempty"`
}

PrioritizerConfig represents the configuration of prioritizer

func (*PrioritizerConfig) DeepCopy added in v0.7.0

func (in *PrioritizerConfig) DeepCopy() *PrioritizerConfig

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

func (*PrioritizerConfig) DeepCopyInto added in v0.7.0

func (in *PrioritizerConfig) DeepCopyInto(out *PrioritizerConfig)

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

func (PrioritizerConfig) SwaggerDoc added in v0.7.0

func (PrioritizerConfig) SwaggerDoc() map[string]string

type PrioritizerPolicy added in v0.7.0

type PrioritizerPolicy struct {
	// Mode is either Exact, Additive, "" where "" is Additive by default.
	// In Additive mode, any prioritizer not explicitly enumerated is enabled in its default Configurations,
	// in which Steady and Balance prioritizers have the weight of 1 while other prioritizers have the weight of 0.
	// Additive doesn't require configuring all prioritizers. The default Configurations may change in the future,
	// and additional prioritization will happen.
	// In Exact mode, any prioritizer not explicitly enumerated is weighted as zero.
	// Exact requires knowing the full set of prioritizers you want, but avoids behavior changes between releases.
	// +kubebuilder:default:=Additive
	// +optional
	Mode PrioritizerPolicyModeType `json:"mode,omitempty"`

	// +optional
	Configurations []PrioritizerConfig `json:"configurations,omitempty"`
}

PrioritizerPolicy represents the policy of prioritizer

func (*PrioritizerPolicy) DeepCopy added in v0.7.0

func (in *PrioritizerPolicy) DeepCopy() *PrioritizerPolicy

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

func (*PrioritizerPolicy) DeepCopyInto added in v0.7.0

func (in *PrioritizerPolicy) DeepCopyInto(out *PrioritizerPolicy)

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

func (PrioritizerPolicy) SwaggerDoc added in v0.7.0

func (PrioritizerPolicy) SwaggerDoc() map[string]string

type PrioritizerPolicyModeType added in v0.7.0

type PrioritizerPolicyModeType string

PrioritizerPolicyModeType represents the type of PrioritizerPolicy.Mode

const (
	// Valid PrioritizerPolicyModeType value is Exact, Additive.
	PrioritizerPolicyModeAdditive PrioritizerPolicyModeType = "Additive"
	PrioritizerPolicyModeExact    PrioritizerPolicyModeType = "Exact"
)

type ScoreCoordinate added in v0.7.0

type ScoreCoordinate struct {
	// Type defines the type of the prioritizer score.
	// Type is either "BuiltIn", "AddOn" or "", where "" is "BuiltIn" by default.
	// When the type is "BuiltIn", need to specify a BuiltIn prioritizer name in BuiltIn.
	// When the type is "AddOn", need to configure the score source in AddOn.
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=BuiltIn;AddOn
	// +kubebuilder:default:=BuiltIn
	// +required
	Type string `json:"type,omitempty"`

	// BuiltIn defines the name of a BuiltIn prioritizer. Below are the valid BuiltIn prioritizer names.
	// 1) Balance: balance the decisions among the clusters.
	// 2) Steady: ensure the existing decision is stabilized.
	// 3) ResourceAllocatableCPU & ResourceAllocatableMemory: sort clusters based on the allocatable.
	// 4) Spread: spread the workload evenly to topologies.
	// +optional
	BuiltIn string `json:"builtIn,omitempty"`

	// When type is "AddOn", AddOn defines the resource name and score name.
	// +optional
	AddOn *AddOnScore `json:"addOn,omitempty"`
}

ScoreCoordinate represents the configuration of the score type and score source

func (*ScoreCoordinate) DeepCopy added in v0.7.0

func (in *ScoreCoordinate) DeepCopy() *ScoreCoordinate

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

func (*ScoreCoordinate) DeepCopyInto added in v0.7.0

func (in *ScoreCoordinate) DeepCopyInto(out *ScoreCoordinate)

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

func (ScoreCoordinate) SwaggerDoc added in v0.7.0

func (ScoreCoordinate) SwaggerDoc() map[string]string

type SelectorType added in v0.7.0

type SelectorType string
const (
	// "LegacyClusterSetLabel" means to use label "cluster.open-cluster-management.io/clusterset:<ManagedClusterSet Name>"" to select target clusters.
	LegacyClusterSetLabel SelectorType = "LegacyClusterSetLabel"
	// "LabelSelector" means use labelSelector to select target managedClusters
	LabelSelector SelectorType = "LabelSelector"
)

type SpreadConstraintsTerm added in v0.10.0

type SpreadConstraintsTerm struct {
	// TopologyKey is either a label key or a cluster claim name of ManagedClusters.
	// +required
	// +kubebuilder:validation:Required
	// +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_.]*)?[A-Za-z0-9]$`
	// +kubebuilder:validation:MaxLength=316
	TopologyKey string `json:"topologyKey"`

	// TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim.
	// +required
	// +kubebuilder:validation:Required
	// +kubebuilder:validation:Enum=Label;Claim
	TopologyKeyType TopologyKeyType `json:"topologyKeyType"`

	// MaxSkew represents the degree to which the workload may be unevenly distributed.
	// Skew is the maximum difference between the number of selected ManagedClusters in a topology and the global minimum.
	// The global minimum is the minimum number of selected ManagedClusters for the topologies within the same TopologyKey.
	// The minimum possible value of MaxSkew is 1, and the default value is 1.
	// +optional
	// +kubebuilder:validation:Minimum=1
	// +kubebuilder:default=1
	MaxSkew int32 `json:"maxSkew"`

	// WhenUnsatisfiable represents the action of the scheduler when MaxSkew cannot be satisfied.
	// It could be DoNotSchedule or ScheduleAnyway. The default value is ScheduleAnyway.
	// DoNotSchedule instructs the scheduler not to schedule more ManagedClusters when MaxSkew is not satisfied.
	// ScheduleAnyway instructs the scheduler to keep scheduling even if MaxSkew is not satisfied.
	// +optional
	// +kubebuilder:validation:Enum=DoNotSchedule;ScheduleAnyway
	// +kubebuilder:default=ScheduleAnyway
	WhenUnsatisfiable UnsatisfiableMaxSkewAction `json:"whenUnsatisfiable"`
}

SpreadConstraintsTerm defines a terminology to spread placement decisions.

func (*SpreadConstraintsTerm) DeepCopy added in v0.10.0

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

func (*SpreadConstraintsTerm) DeepCopyInto added in v0.10.0

func (in *SpreadConstraintsTerm) DeepCopyInto(out *SpreadConstraintsTerm)

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

func (SpreadConstraintsTerm) SwaggerDoc added in v0.10.0

func (SpreadConstraintsTerm) SwaggerDoc() map[string]string

type SpreadPolicy added in v0.10.0

type SpreadPolicy struct {
	// SpreadConstraints defines how the placement decision should be distributed among a set of ManagedClusters.
	// The importance of the SpreadConstraintsTerms follows the natural order of their index in the slice.
	// The scheduler first consider SpreadConstraintsTerms with smaller index then those with larger index
	// to distribute the placement decision.
	// +optional
	// +kubebuilder:validation:MaxItems=8
	SpreadConstraints []SpreadConstraintsTerm `json:"spreadConstraints,omitempty"`
}

SpreadPolicy defines how the placement decision should be spread among the ManagedClusters.

func (*SpreadPolicy) DeepCopy added in v0.10.0

func (in *SpreadPolicy) DeepCopy() *SpreadPolicy

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

func (*SpreadPolicy) DeepCopyInto added in v0.10.0

func (in *SpreadPolicy) DeepCopyInto(out *SpreadPolicy)

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

func (SpreadPolicy) SwaggerDoc added in v0.10.0

func (SpreadPolicy) SwaggerDoc() map[string]string

type Toleration added in v0.7.0

type Toleration struct {
	// Key is the taint key that the toleration applies to. Empty means match all taint keys.
	// If the key is empty, operator must be Exists; this combination means to match all values and all keys.
	// +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_.]*)?[A-Za-z0-9])$`
	// +kubebuilder:validation:MaxLength=316
	// +optional
	Key string `json:"key,omitempty"`
	// Operator represents a key's relationship to the value.
	// Valid operators are Exists and Equal. Defaults to Equal.
	// Exists is equivalent to wildcard for value, so that a placement can
	// tolerate all taints of a particular category.
	// +kubebuilder:default:="Equal"
	// +optional
	Operator TolerationOperator `json:"operator,omitempty"`
	// Value is the taint value the toleration matches to.
	// If the operator is Exists, the value should be empty, otherwise just a regular string.
	// +kubebuilder:validation:MaxLength=1024
	// +optional
	Value string `json:"value,omitempty"`
	// Effect indicates the taint effect to match. Empty means match all taint effects.
	// When specified, allowed values are NoSelect, PreferNoSelect and NoSelectIfNew.
	// +kubebuilder:validation:Enum:=NoSelect;PreferNoSelect;NoSelectIfNew
	// +optional
	Effect v1.TaintEffect `json:"effect,omitempty"`
	// TolerationSeconds represents the period of time the toleration (which must be of effect
	// NoSelect/PreferNoSelect, otherwise this field is ignored) tolerates the taint.
	// The default value is nil, which indicates it tolerates the taint forever.
	// The start time of counting the TolerationSeconds should be the TimeAdded in Taint, not the cluster
	// scheduled time or TolerationSeconds added time.
	// +optional
	TolerationSeconds *int64 `json:"tolerationSeconds,omitempty"`
}

Toleration represents the toleration object that can be attached to a placement. The placement this Toleration is attached to tolerates any taint that matches the triple <key,value,effect> using the matching operator <operator>.

func (*Toleration) DeepCopy added in v0.7.0

func (in *Toleration) DeepCopy() *Toleration

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

func (*Toleration) DeepCopyInto added in v0.7.0

func (in *Toleration) DeepCopyInto(out *Toleration)

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

func (Toleration) SwaggerDoc added in v0.7.0

func (Toleration) SwaggerDoc() map[string]string

type TolerationOperator added in v0.7.0

type TolerationOperator string

TolerationOperator is the set of operators that can be used in a toleration.

const (
	TolerationOpExists TolerationOperator = "Exists"
	TolerationOpEqual  TolerationOperator = "Equal"
)

These are valid values for TolerationOperator

type TopologyKeyType added in v0.10.0

type TopologyKeyType string

TopologyKeyType represents the type of TopologyKey.

const (
	// Valid TopologyKeyType value is Claim, Label.
	TopologyKeyTypeClaim TopologyKeyType = "Claim"
	TopologyKeyTypeLabel TopologyKeyType = "Label"
)

type UnsatisfiableMaxSkewAction added in v0.10.0

type UnsatisfiableMaxSkewAction string

UnsatisfiableMaxSkewAction represents the action when MaxSkew cannot be satisfied.

const (
	// Valid UnsatisfiableMaxSkewAction value is DoNotSchedule, ScheduleAnyway.
	DoNotSchedule  UnsatisfiableMaxSkewAction = "DoNotSchedule"
	ScheduleAnyway UnsatisfiableMaxSkewAction = "ScheduleAnyway"
)

Jump to

Keyboard shortcuts

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