Documentation ¶
Overview ¶
+kubebuilder:validation:Optional +groupName=cluster.open-cluster-management.io
Index ¶
- Constants
- Variables
- func Resource(resource string) schema.GroupResource
- type AddOnScore
- type ClusterClaimSelector
- type ClusterDecision
- type ClusterPredicate
- type ClusterSelector
- type DecisionGroup
- type DecisionGroupStatus
- type DecisionStrategy
- type GroupStrategy
- type Placement
- type PlacementDecision
- type PlacementDecisionList
- type PlacementDecisionStatus
- type PlacementList
- type PlacementSpec
- type PlacementStatus
- type PrioritizerConfig
- type PrioritizerPolicy
- type PrioritizerPolicyModeType
- type ScoreCoordinate
- type SpreadConstraintsTerm
- type SpreadPolicy
- type Toleration
- type TolerationOperator
- type TopologyKeyType
- type UnsatisfiableMaxSkewAction
Constants ¶
const ( // Valid ScoreCoordinate type is BuiltIn, AddOn. ScoreCoordinateTypeBuiltIn string = "BuiltIn" ScoreCoordinateTypeAddOn string = "AddOn" )
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" )
const ( // Placement owner name. PlacementLabel string = "cluster.open-cluster-management.io/placement" // decision group index. DecisionGroupIndexLabel string = "cluster.open-cluster-management.io/decision-group-index" // decision group name. DecisionGroupNameLabel string = "cluster.open-cluster-management.io/decision-group-name" )
The placementDecsion labels
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" )
Variables ¶
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 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
func (in *ClusterClaimSelector) DeepCopy() *ClusterClaimSelector
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 DecisionGroup ¶ added in v0.12.0
type DecisionGroup struct { // Group name to be added as label value to the created placement Decisions labels with label key cluster.open-cluster-management.io/decision-group-name // +kubebuilder:validation:Required // +kubebuilder:validation:Pattern="^[a-zA-Z0-9][-A-Za-z0-9_.]{0,61}[a-zA-Z0-9]$" // +required GroupName string `json:"groupName,omitempty"` // LabelSelector to select clusters subset by label. // +kubebuilder:validation:Required // +required ClusterSelector ClusterSelector `json:"groupClusterSelector,omitempty"` }
DecisionGroup define a subset of clusters that will be added to placementDecisions with groupName label.
func (*DecisionGroup) DeepCopy ¶ added in v0.12.0
func (in *DecisionGroup) DeepCopy() *DecisionGroup
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecisionGroup.
func (*DecisionGroup) DeepCopyInto ¶ added in v0.12.0
func (in *DecisionGroup) DeepCopyInto(out *DecisionGroup)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (DecisionGroup) SwaggerDoc ¶ added in v0.12.0
func (DecisionGroup) SwaggerDoc() map[string]string
type DecisionGroupStatus ¶ added in v0.12.0
type DecisionGroupStatus struct { // Present the decision group index. If there is no decision strategy defined all placement decisions will be in group index 0 // +optional DecisionGroupIndex int32 `json:"decisionGroupIndex"` // Decision group name that is defined in the DecisionStrategy's DecisionGroup. // +optional DecisionGroupName string `json:"decisionGroupName"` // List of placement decisions names associated with the decision group // +optional Decisions []string `json:"decisions"` // Total number of clusters in the decision group. Clusters count is equal or less than the clusterPerDecisionGroups defined in the decision strategy. // +kubebuilder:default:=0 // +optional ClustersCount int32 `json:"clusterCount"` }
Present decision groups status based on the DecisionStrategy definition.
func (*DecisionGroupStatus) DeepCopy ¶ added in v0.12.0
func (in *DecisionGroupStatus) DeepCopy() *DecisionGroupStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecisionGroupStatus.
func (*DecisionGroupStatus) DeepCopyInto ¶ added in v0.12.0
func (in *DecisionGroupStatus) DeepCopyInto(out *DecisionGroupStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (DecisionGroupStatus) SwaggerDoc ¶ added in v0.12.0
func (DecisionGroupStatus) SwaggerDoc() map[string]string
type DecisionStrategy ¶ added in v0.12.0
type DecisionStrategy struct { // GroupStrategy define strategies to divide selected clusters to decision groups. // +optional GroupStrategy GroupStrategy `json:"groupStrategy,omitempty"` }
DecisionStrategy divide the created placement decision to groups and define number of clusters per decision group.
func (*DecisionStrategy) DeepCopy ¶ added in v0.12.0
func (in *DecisionStrategy) DeepCopy() *DecisionStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DecisionStrategy.
func (*DecisionStrategy) DeepCopyInto ¶ added in v0.12.0
func (in *DecisionStrategy) DeepCopyInto(out *DecisionStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (DecisionStrategy) SwaggerDoc ¶ added in v0.12.0
func (DecisionStrategy) SwaggerDoc() map[string]string
type GroupStrategy ¶ added in v0.12.0
type GroupStrategy struct { // DecisionGroups represents a list of predefined groups to put decision results. // Decision groups will be constructed based on the DecisionGroups field at first. The clusters not included in the // DecisionGroups will be divided to other decision groups afterwards. Each decision group should not have the number // of clusters larger than the ClustersPerDecisionGroup. // +optional DecisionGroups []DecisionGroup `json:"decisionGroups,omitempty"` // ClustersPerDecisionGroup is a specific number or percentage of the total selected clusters. // The specific number will divide the placementDecisions to decisionGroups each group has max number of clusters // equal to that specific number. // The percentage will divide the placementDecisions to decisionGroups each group has max number of clusters based // on the total num of selected clusters and percentage. // ex; for a total 100 clusters selected, ClustersPerDecisionGroup equal to 20% will divide the placement decision // to 5 groups each group should have 20 clusters. // Default is having all clusters in a single group. // // The predefined decisionGroups is expected to be a subset of the selected clusters and the number of items in each // group SHOULD be less than ClustersPerDecisionGroup. Once the number of items exceeds the ClustersPerDecisionGroup, // the decisionGroups will also be be divided into multiple decisionGroups with same GroupName but different GroupIndex. // // +kubebuilder:validation:XIntOrString // +kubebuilder:validation:Pattern=`^((100|[1-9][0-9]{0,1})%|[1-9][0-9]*)$` // +kubebuilder:default:="100%" // +optional ClustersPerDecisionGroup intstr.IntOrString `json:"clustersPerDecisionGroup,omitempty"` }
Group the created placementDecision into decision groups based on the number of clusters per decision group.
func (*GroupStrategy) DeepCopy ¶ added in v0.12.0
func (in *GroupStrategy) DeepCopy() *GroupStrategy
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GroupStrategy.
func (*GroupStrategy) DeepCopyInto ¶ added in v0.12.0
func (in *GroupStrategy) DeepCopyInto(out *GroupStrategy)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (GroupStrategy) SwaggerDoc ¶ added in v0.12.0
func (GroupStrategy) SwaggerDoc() map[string]string
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:
- Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters;
- ManagedClusters are organized into cluster-scoped ManagedClusterSets;
- ManagedClusterSets are bound to workload namespaces;
- Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set of potential ManagedClusters;
- Then Placements subselect from that working set using label/claim selection.
A ManagedCluster will not be selected if no ManagedClusterSet is bound to the placement namespace. A user is able to bind a ManagedClusterSet to a namespace by creating a ManagedClusterSetBinding in that namespace if they have an RBAC rule to CREATE on the virtual subresource of `managedclustersets/bind`.
A slice of PlacementDecisions with the 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
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Placement.
func (*Placement) DeepCopyInto ¶ added in v0.7.0
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
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (Placement) SwaggerDoc ¶ added in v0.7.0
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 must have a cluster.open-cluster-management.io/placement={placement name} label to reference a certain placement.
If a placement has spec.numberOfClusters specified, the total number of decisions contained in the status.decisions of PlacementDecisions must be the same as NumberOfClusters. Otherwise, the total number of decisions must equal the number of ManagedClusters that match the placement requirements.
Some of the decisions might be empty when there are not enough ManagedClusters to 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 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
func (in *PlacementDecisionList) DeepCopy() *PlacementDecisionList
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
func (in *PlacementDecisionStatus) DeepCopy() *PlacementDecisionStatus
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"` // DecisionStrategy divide the created placement decision to groups and define number of clusters per decision group. // +optional DecisionStrategy DecisionStrategy `json:"decisionStrategy,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"` // List of decision groups determined by the placement and DecisionStrategy. // +optional DecisionGroups []DecisionGroupStatus `json:"decisionGroups"` // 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 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
func (in *SpreadConstraintsTerm) DeepCopy() *SpreadConstraintsTerm
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" )