mirror of
https://github.com/open-cluster-management-io/ocm.git
synced 2026-08-19 04:06:35 +00:00
update clustermanangementaddon api (#300)
Signed-off-by: Wei Liu <liuweixa@redhat.com> Signed-off-by: Wei Liu <liuweixa@redhat.com>
This commit is contained in:
@@ -18,7 +18,7 @@ IMAGE_TAG?=latest
|
||||
IMAGE_NAME?=$(IMAGE_REGISTRY)/registration-operator:$(IMAGE_TAG)
|
||||
|
||||
# CSV_VERSION is used to generate new CSV manifests
|
||||
CSV_VERSION?=0.9.0
|
||||
CSV_VERSION?=0.10.0
|
||||
|
||||
# WORK_IMAGE can be set in the env to override calculated value
|
||||
WORK_TAG?=latest
|
||||
|
||||
+1
-1
@@ -63,7 +63,7 @@ metadata:
|
||||
operators.operatorframework.io/project_layout: go
|
||||
repository: https://github.com/open-cluster-management-io/registration-operator
|
||||
support: Red Hat, Inc.
|
||||
name: cluster-manager.v0.9.0
|
||||
name: cluster-manager.v0.10.0
|
||||
namespace: placeholder
|
||||
spec:
|
||||
apiservicedefinitions: {}
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ metadata:
|
||||
operators.operatorframework.io/project_layout: go
|
||||
repository: https://github.com/open-cluster-management-io/registration-operator
|
||||
support: Red Hat, Inc.
|
||||
name: klusterlet.v0.9.0
|
||||
name: klusterlet.v0.10.0
|
||||
namespace: placeholder
|
||||
spec:
|
||||
apiservicedefinitions: {}
|
||||
|
||||
@@ -19,7 +19,7 @@ require (
|
||||
k8s.io/component-base v0.24.3
|
||||
k8s.io/klog/v2 v2.70.0
|
||||
k8s.io/kube-aggregator v0.24.3
|
||||
open-cluster-management.io/api v0.9.1-0.20221031031432-8b08a2ec335b
|
||||
open-cluster-management.io/api v0.9.1-0.20221107101616-fde10e6996f6
|
||||
sigs.k8s.io/controller-runtime v0.12.3
|
||||
sigs.k8s.io/kube-storage-version-migrator v0.0.5
|
||||
)
|
||||
|
||||
@@ -1234,8 +1234,8 @@ k8s.io/utils v0.0.0-20201110183641-67b214c5f920/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
|
||||
k8s.io/utils v0.0.0-20210802155522-efc7438f0176/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9 h1:HNSDgDCrr/6Ly3WEGKZftiE7IY19Vz2GdbOCyI4qqhc=
|
||||
k8s.io/utils v0.0.0-20220210201930-3a6ce19ff2f9/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
|
||||
open-cluster-management.io/api v0.9.1-0.20221031031432-8b08a2ec335b h1:ETkAxS9D/I3/DNYPO+FPVoz9BndQw2NJ1nQu6Aw3zXg=
|
||||
open-cluster-management.io/api v0.9.1-0.20221031031432-8b08a2ec335b/go.mod h1:+OEARSAl2jIhuLItUcS30UgLA3khmA9ihygLVxzEn+U=
|
||||
open-cluster-management.io/api v0.9.1-0.20221107101616-fde10e6996f6 h1:jXx0C2GKScyZSxyyvswxmgspQgx7SnBic80EM57EdOw=
|
||||
open-cluster-management.io/api v0.9.1-0.20221107101616-fde10e6996f6/go.mod h1:9KkJPh/zpDevXj2P+zkvSVjC2pq2PQ1JDNLLEes8TEc=
|
||||
rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8=
|
||||
rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0=
|
||||
rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA=
|
||||
|
||||
+5
@@ -86,10 +86,15 @@ spec:
|
||||
group:
|
||||
description: group of the add-on configuration.
|
||||
type: string
|
||||
default: ""
|
||||
resource:
|
||||
description: resource of the add-on configuration.
|
||||
type: string
|
||||
minLength: 1
|
||||
x-kubernetes-list-map-keys:
|
||||
- group
|
||||
- resource
|
||||
x-kubernetes-list-type: map
|
||||
status:
|
||||
description: status represents the current status of cluster management add-on.
|
||||
type: object
|
||||
|
||||
+6
-6
@@ -43,9 +43,9 @@ spec:
|
||||
openAPIV3Schema:
|
||||
description: "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
|
||||
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 \n 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
|
||||
@@ -227,9 +227,9 @@ spec:
|
||||
openAPIV3Schema:
|
||||
description: "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
|
||||
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 \n 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
|
||||
|
||||
+2
@@ -54,6 +54,7 @@ spec:
|
||||
group:
|
||||
description: group of the add-on configuration.
|
||||
type: string
|
||||
default: ""
|
||||
name:
|
||||
description: name of the add-on configuration.
|
||||
type: string
|
||||
@@ -156,6 +157,7 @@ spec:
|
||||
group:
|
||||
description: group of the add-on configuration.
|
||||
type: string
|
||||
default: ""
|
||||
lastObservedGeneration:
|
||||
description: lastObservedGeneration is the observed generation of the add-on configuration.
|
||||
type: integer
|
||||
|
||||
+41
-2
@@ -25,7 +25,7 @@ spec:
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n 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. \n 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`. \n 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. \n 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."
|
||||
description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n 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. \n 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`. \n 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. \n 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."
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
@@ -149,7 +149,7 @@ spec:
|
||||
description: 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.
|
||||
type: string
|
||||
builtIn:
|
||||
description: '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.'
|
||||
description: '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.'
|
||||
type: string
|
||||
type:
|
||||
description: 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.
|
||||
@@ -169,6 +169,45 @@ spec:
|
||||
description: 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.
|
||||
type: string
|
||||
default: Additive
|
||||
spreadPolicy:
|
||||
description: SpreadPolicy defines how placement decisions should be distributed among a set of ManagedClusters.
|
||||
type: object
|
||||
properties:
|
||||
spreadConstraints:
|
||||
description: 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.
|
||||
type: array
|
||||
maxItems: 8
|
||||
items:
|
||||
description: SpreadConstraintsTerm defines a terminology to spread placement decisions.
|
||||
type: object
|
||||
required:
|
||||
- topologyKey
|
||||
- topologyKeyType
|
||||
properties:
|
||||
maxSkew:
|
||||
description: 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.
|
||||
type: integer
|
||||
format: int32
|
||||
default: 1
|
||||
minimum: 1
|
||||
topologyKey:
|
||||
description: TopologyKey is either a label key or a cluster claim name of ManagedClusters.
|
||||
type: string
|
||||
maxLength: 316
|
||||
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]$
|
||||
topologyKeyType:
|
||||
description: TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim.
|
||||
type: string
|
||||
enum:
|
||||
- Label
|
||||
- Claim
|
||||
whenUnsatisfiable:
|
||||
description: 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.
|
||||
type: string
|
||||
default: ScheduleAnyway
|
||||
enum:
|
||||
- DoNotSchedule
|
||||
- ScheduleAnyway
|
||||
tolerations:
|
||||
description: 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.
|
||||
type: array
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@ spec:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.
|
||||
description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub."
|
||||
type: object
|
||||
properties:
|
||||
apiVersion:
|
||||
|
||||
+1
-1
@@ -13,7 +13,7 @@ spec:
|
||||
preserveUnknownFields: false
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.
|
||||
description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub."
|
||||
type: object
|
||||
properties:
|
||||
apiVersion:
|
||||
|
||||
Vendored
+2
-2
@@ -1190,8 +1190,8 @@ k8s.io/utils/path
|
||||
k8s.io/utils/pointer
|
||||
k8s.io/utils/strings/slices
|
||||
k8s.io/utils/trace
|
||||
# open-cluster-management.io/api v0.9.1-0.20221031031432-8b08a2ec335b
|
||||
## explicit; go 1.18
|
||||
# open-cluster-management.io/api v0.9.1-0.20221107101616-fde10e6996f6
|
||||
## explicit; go 1.19
|
||||
open-cluster-management.io/api/addon/v1alpha1
|
||||
open-cluster-management.io/api/client/addon/clientset/versioned
|
||||
open-cluster-management.io/api/client/addon/clientset/versioned/scheme
|
||||
|
||||
Generated
Vendored
+5
@@ -86,10 +86,15 @@ spec:
|
||||
group:
|
||||
description: group of the add-on configuration.
|
||||
type: string
|
||||
default: ""
|
||||
resource:
|
||||
description: resource of the add-on configuration.
|
||||
type: string
|
||||
minLength: 1
|
||||
x-kubernetes-list-map-keys:
|
||||
- group
|
||||
- resource
|
||||
x-kubernetes-list-type: map
|
||||
status:
|
||||
description: status represents the current status of cluster management add-on.
|
||||
type: object
|
||||
|
||||
Generated
Vendored
+2
@@ -54,6 +54,7 @@ spec:
|
||||
group:
|
||||
description: group of the add-on configuration.
|
||||
type: string
|
||||
default: ""
|
||||
name:
|
||||
description: name of the add-on configuration.
|
||||
type: string
|
||||
@@ -156,6 +157,7 @@ spec:
|
||||
group:
|
||||
description: group of the add-on configuration.
|
||||
type: string
|
||||
default: ""
|
||||
lastObservedGeneration:
|
||||
description: lastObservedGeneration is the observed generation of the add-on configuration.
|
||||
type: integer
|
||||
|
||||
Generated
Vendored
+5
@@ -48,6 +48,9 @@ type ClusterManagementAddOnSpec struct {
|
||||
// An empty list means the add-on does not require configurations.
|
||||
// The default is an empty list
|
||||
// +optional
|
||||
// +listType=map
|
||||
// +listMapKey=group
|
||||
// +listMapKey=resource
|
||||
SupportedConfigs []ConfigMeta `json:"supportedConfigs,omitempty"`
|
||||
}
|
||||
|
||||
@@ -93,6 +96,8 @@ type ConfigCoordinates struct {
|
||||
// ConfigGroupResource represents the GroupResource of the add-on configuration
|
||||
type ConfigGroupResource struct {
|
||||
// group of the add-on configuration.
|
||||
// +optional
|
||||
// +kubebuilder:default=""
|
||||
Group string `json:"group"`
|
||||
|
||||
// resource of the add-on configuration.
|
||||
|
||||
Generated
Vendored
+7
-7
@@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
||||
Generated
Vendored
+7
-7
@@ -27,14 +27,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
||||
Generated
Vendored
+7
-7
@@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
||||
Generated
Vendored
+7
-7
@@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
||||
Generated
Vendored
+7
-7
@@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
||||
Generated
Vendored
+7
-7
@@ -21,14 +21,14 @@ var localSchemeBuilder = runtime.SchemeBuilder{
|
||||
// AddToScheme adds all types of this clientset into the given scheme. This allows composition
|
||||
// of clientsets, like in:
|
||||
//
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
// import (
|
||||
// "k8s.io/client-go/kubernetes"
|
||||
// clientsetscheme "k8s.io/client-go/kubernetes/scheme"
|
||||
// aggregatorclientsetscheme "k8s.io/kube-aggregator/pkg/client/clientset_generated/clientset/scheme"
|
||||
// )
|
||||
//
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
// kclientset, _ := kubernetes.NewForConfig(c)
|
||||
// _ = aggregatorclientsetscheme.AddToScheme(clientsetscheme.Scheme)
|
||||
//
|
||||
// After this, RawExtensions in Kubernetes types will serialize kube-aggregator types
|
||||
// correctly.
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -15,7 +15,7 @@ spec:
|
||||
- name: v1alpha1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.
|
||||
description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub."
|
||||
type: object
|
||||
properties:
|
||||
apiVersion:
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -13,7 +13,7 @@ spec:
|
||||
preserveUnknownFields: false
|
||||
validation:
|
||||
openAPIV3Schema:
|
||||
description: ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.
|
||||
description: "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include, 1. id.k8s.io, it contains a unique identifier for the cluster. 2. clusterset.k8s.io, it contains an identifier that relates the cluster to the ClusterSet in which it belongs. \n ClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub."
|
||||
type: object
|
||||
properties:
|
||||
apiVersion:
|
||||
|
||||
+4
-3
@@ -11,9 +11,10 @@ import (
|
||||
|
||||
// ClusterClaim represents cluster information that a managed cluster claims
|
||||
// ClusterClaims with well known names include,
|
||||
// 1. id.k8s.io, it contains a unique identifier for the cluster.
|
||||
// 2. clusterset.k8s.io, it contains an identifier that relates the cluster
|
||||
// to the ClusterSet in which it belongs.
|
||||
// 1. id.k8s.io, it contains a unique identifier for the cluster.
|
||||
// 2. clusterset.k8s.io, it contains an identifier that relates the cluster
|
||||
// to the ClusterSet in which it belongs.
|
||||
//
|
||||
// ClusterClaims created on a managed cluster will be collected and saved into
|
||||
// the status of the corresponding ManagedCluster on hub.
|
||||
type ClusterClaim struct {
|
||||
|
||||
Generated
Vendored
+2
-2
@@ -20,7 +20,7 @@ type AddOnPlacementScore struct {
|
||||
Status AddOnPlacementScoreStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
//AddOnPlacementScoreStatus represents the current status of AddOnPlacementScore.
|
||||
// AddOnPlacementScoreStatus represents the current status of AddOnPlacementScore.
|
||||
type AddOnPlacementScoreStatus struct {
|
||||
// Conditions contain the different condition statuses for this AddOnPlacementScore.
|
||||
// +patchMergeKey=type
|
||||
@@ -45,7 +45,7 @@ type AddOnPlacementScoreStatus struct {
|
||||
ValidUntil *metav1.Time `json:"validUntil"`
|
||||
}
|
||||
|
||||
//AddOnPlacementScoreItem represents the score name and value.
|
||||
// AddOnPlacementScoreItem represents the score name and value.
|
||||
type AddOnPlacementScoreItem struct {
|
||||
// Name is the name of the score
|
||||
// +kubebuilder:validation:Required
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -12,7 +12,7 @@ package v1alpha1
|
||||
|
||||
// AUTO-GENERATED FUNCTIONS START HERE
|
||||
var map_ClusterClaim = map[string]string{
|
||||
"": "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include,\n 1. id.k8s.io, it contains a unique identifier for the cluster.\n 2. clusterset.k8s.io, it contains an identifier that relates the cluster\n to the ClusterSet in which it belongs.\nClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.",
|
||||
"": "ClusterClaim represents cluster information that a managed cluster claims ClusterClaims with well known names include,\n 1. id.k8s.io, it contains a unique identifier for the cluster.\n 2. clusterset.k8s.io, it contains an identifier that relates the cluster\n to the ClusterSet in which it belongs.\n\nClusterClaims created on a managed cluster will be collected and saved into the status of the corresponding ManagedCluster on hub.",
|
||||
"spec": "Spec defines the attributes of the ClusterClaim.",
|
||||
}
|
||||
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -25,7 +25,7 @@ spec:
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: "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 \n 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."
|
||||
description: "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 \n 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."
|
||||
type: object
|
||||
properties:
|
||||
apiVersion:
|
||||
|
||||
Generated
Vendored
+41
-2
@@ -25,7 +25,7 @@ spec:
|
||||
name: v1beta1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n 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. \n 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`. \n 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. \n 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."
|
||||
description: "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace. \n 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. \n 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`. \n 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. \n 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."
|
||||
type: object
|
||||
required:
|
||||
- spec
|
||||
@@ -149,7 +149,7 @@ spec:
|
||||
description: 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.
|
||||
type: string
|
||||
builtIn:
|
||||
description: '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.'
|
||||
description: '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.'
|
||||
type: string
|
||||
type:
|
||||
description: 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.
|
||||
@@ -169,6 +169,45 @@ spec:
|
||||
description: 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.
|
||||
type: string
|
||||
default: Additive
|
||||
spreadPolicy:
|
||||
description: SpreadPolicy defines how placement decisions should be distributed among a set of ManagedClusters.
|
||||
type: object
|
||||
properties:
|
||||
spreadConstraints:
|
||||
description: 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.
|
||||
type: array
|
||||
maxItems: 8
|
||||
items:
|
||||
description: SpreadConstraintsTerm defines a terminology to spread placement decisions.
|
||||
type: object
|
||||
required:
|
||||
- topologyKey
|
||||
- topologyKeyType
|
||||
properties:
|
||||
maxSkew:
|
||||
description: 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.
|
||||
type: integer
|
||||
format: int32
|
||||
default: 1
|
||||
minimum: 1
|
||||
topologyKey:
|
||||
description: TopologyKey is either a label key or a cluster claim name of ManagedClusters.
|
||||
type: string
|
||||
maxLength: 316
|
||||
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]$
|
||||
topologyKeyType:
|
||||
description: TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim.
|
||||
type: string
|
||||
enum:
|
||||
- Label
|
||||
- Claim
|
||||
whenUnsatisfiable:
|
||||
description: 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.
|
||||
type: string
|
||||
default: ScheduleAnyway
|
||||
enum:
|
||||
- DoNotSchedule
|
||||
- ScheduleAnyway
|
||||
tolerations:
|
||||
description: 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.
|
||||
type: array
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
//LegacyClusterSetLabel LabelKey
|
||||
// LegacyClusterSetLabel LabelKey
|
||||
const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset"
|
||||
|
||||
// +genclient
|
||||
@@ -18,9 +18,9 @@ const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset"
|
||||
|
||||
// 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
|
||||
// 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.
|
||||
|
||||
+75
-6
@@ -18,12 +18,12 @@ import (
|
||||
//
|
||||
// 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.
|
||||
// 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
|
||||
@@ -85,6 +85,11 @@ type PlacementSpec struct {
|
||||
// +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
|
||||
@@ -185,6 +190,7 @@ type ScoreCoordinate struct {
|
||||
// 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"`
|
||||
|
||||
@@ -215,6 +221,69 @@ type AddOnScore struct {
|
||||
ScoreName string `json:"scoreName"`
|
||||
}
|
||||
|
||||
// SpreadPolicy defines how the placement decision should be spread among the ManagedClusters.
|
||||
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"`
|
||||
}
|
||||
|
||||
// SpreadConstraintsTerm defines a terminology to spread placement decisions.
|
||||
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"`
|
||||
}
|
||||
|
||||
// TopologyKeyType represents the type of TopologyKey.
|
||||
type TopologyKeyType string
|
||||
|
||||
const (
|
||||
// Valid TopologyKeyType value is Claim, Label.
|
||||
TopologyKeyTypeClaim TopologyKeyType = "Claim"
|
||||
TopologyKeyTypeLabel TopologyKeyType = "Label"
|
||||
)
|
||||
|
||||
// UnsatisfiableMaxSkewAction represents the action when MaxSkew cannot be satisfied.
|
||||
type UnsatisfiableMaxSkewAction string
|
||||
|
||||
const (
|
||||
// Valid UnsatisfiableMaxSkewAction value is DoNotSchedule, ScheduleAnyway.
|
||||
DoNotSchedule UnsatisfiableMaxSkewAction = "DoNotSchedule"
|
||||
ScheduleAnyway UnsatisfiableMaxSkewAction = "ScheduleAnyway"
|
||||
)
|
||||
|
||||
// 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>.
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ type PlacementDecision struct {
|
||||
Status PlacementDecisionStatus `json:"status,omitempty"`
|
||||
}
|
||||
|
||||
//The placementDecsion label name holding the placement name
|
||||
// The placementDecsion label name holding the placement name
|
||||
const (
|
||||
PlacementLabel string = "cluster.open-cluster-management.io/placement"
|
||||
)
|
||||
|
||||
+38
@@ -485,6 +485,7 @@ func (in *PlacementSpec) DeepCopyInto(out *PlacementSpec) {
|
||||
}
|
||||
}
|
||||
in.PrioritizerPolicy.DeepCopyInto(&out.PrioritizerPolicy)
|
||||
in.SpreadPolicy.DeepCopyInto(&out.SpreadPolicy)
|
||||
if in.Tolerations != nil {
|
||||
in, out := &in.Tolerations, &out.Tolerations
|
||||
*out = make([]Toleration, len(*in))
|
||||
@@ -593,6 +594,43 @@ func (in *ScoreCoordinate) DeepCopy() *ScoreCoordinate {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SpreadConstraintsTerm) DeepCopyInto(out *SpreadConstraintsTerm) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpreadConstraintsTerm.
|
||||
func (in *SpreadConstraintsTerm) DeepCopy() *SpreadConstraintsTerm {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SpreadConstraintsTerm)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SpreadPolicy) DeepCopyInto(out *SpreadPolicy) {
|
||||
*out = *in
|
||||
if in.SpreadConstraints != nil {
|
||||
in, out := &in.SpreadConstraints, &out.SpreadConstraints
|
||||
*out = make([]SpreadConstraintsTerm, len(*in))
|
||||
copy(*out, *in)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SpreadPolicy.
|
||||
func (in *SpreadPolicy) DeepCopy() *SpreadPolicy {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SpreadPolicy)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *Toleration) DeepCopyInto(out *Toleration) {
|
||||
*out = *in
|
||||
|
||||
Generated
Vendored
+25
-3
@@ -22,7 +22,7 @@ func (ManagedClusterSelector) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_ManagedClusterSet = map[string]string{
|
||||
"": "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:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn 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.",
|
||||
"": "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:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn 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.",
|
||||
"spec": "Spec defines the attributes of the ManagedClusterSet",
|
||||
"status": "Status represents the current status of the ManagedClusterSet",
|
||||
}
|
||||
@@ -136,7 +136,7 @@ func (ClusterSelector) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_Placement = map[string]string{
|
||||
"": "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace.\n\nHere 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\n of potential ManagedClusters;\n5) Then Placements subselect from that working set using label/claim selection.\n\nNo 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`.\n\nA slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement.\n\nIf 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.",
|
||||
"": "Placement defines a rule to select a set of ManagedClusters from the ManagedClusterSets bound to the placement namespace.\n\nHere is how the placement policy combines with other selection methods to determine a matching list of ManagedClusters:\n 1. Kubernetes clusters are registered with hub as cluster-scoped ManagedClusters;\n 2. ManagedClusters are organized into cluster-scoped ManagedClusterSets;\n 3. ManagedClusterSets are bound to workload namespaces;\n 4. Namespace-scoped Placements specify a slice of ManagedClusterSets which select a working set\n of potential ManagedClusters;\n 5. Then Placements subselect from that working set using label/claim selection.\n\nNo 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`.\n\nA slice of PlacementDecisions with label cluster.open-cluster-management.io/placement={placement name} will be created to represent the ManagedClusters selected by this placement.\n\nIf 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.",
|
||||
"spec": "Spec defines the attributes of Placement.",
|
||||
"status": "Status represents the current status of the Placement",
|
||||
}
|
||||
@@ -161,6 +161,7 @@ var map_PlacementSpec = map[string]string{
|
||||
"numberOfClusters": "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,\n and Predicates) will be selected;\n2) Otherwise if the nubmer of ManagedClusters meet the placement requirements is larger than\n NumberOfClusters, a random subset with desired number of ManagedClusters will be selected;\n3) If the nubmer of ManagedClusters meet the placement requirements is equal to NumberOfClusters,\n all of them will be selected;\n4) If the nubmer of ManagedClusters meet the placement requirements is less than NumberOfClusters,\n all of them will be selected, and the status of condition `PlacementConditionSatisfied` will be\n set to false;",
|
||||
"predicates": "Predicates represent a slice of predicates to select ManagedClusters. The predicates are ORed.",
|
||||
"prioritizerPolicy": "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.",
|
||||
"spreadPolicy": "SpreadPolicy defines how placement decisions should be distributed among a set of ManagedClusters.",
|
||||
"tolerations": "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.",
|
||||
}
|
||||
|
||||
@@ -199,7 +200,7 @@ func (PrioritizerPolicy) SwaggerDoc() map[string]string {
|
||||
var map_ScoreCoordinate = map[string]string{
|
||||
"": "ScoreCoordinate represents the configuration of the score type and score source",
|
||||
"type": "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.",
|
||||
"builtIn": "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.",
|
||||
"builtIn": "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.",
|
||||
"addOn": "When type is \"AddOn\", AddOn defines the resource name and score name.",
|
||||
}
|
||||
|
||||
@@ -207,6 +208,27 @@ func (ScoreCoordinate) SwaggerDoc() map[string]string {
|
||||
return map_ScoreCoordinate
|
||||
}
|
||||
|
||||
var map_SpreadConstraintsTerm = map[string]string{
|
||||
"": "SpreadConstraintsTerm defines a terminology to spread placement decisions.",
|
||||
"topologyKey": "TopologyKey is either a label key or a cluster claim name of ManagedClusters.",
|
||||
"topologyKeyType": "TopologyKeyType indicates the type of TopologyKey. It could be Label or Claim.",
|
||||
"maxSkew": "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.",
|
||||
"whenUnsatisfiable": "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.",
|
||||
}
|
||||
|
||||
func (SpreadConstraintsTerm) SwaggerDoc() map[string]string {
|
||||
return map_SpreadConstraintsTerm
|
||||
}
|
||||
|
||||
var map_SpreadPolicy = map[string]string{
|
||||
"": "SpreadPolicy defines how the placement decision should be spread among the ManagedClusters.",
|
||||
"spreadConstraints": "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.",
|
||||
}
|
||||
|
||||
func (SpreadPolicy) SwaggerDoc() map[string]string {
|
||||
return map_SpreadPolicy
|
||||
}
|
||||
|
||||
var map_Toleration = map[string]string{
|
||||
"": "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>.",
|
||||
"key": "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.",
|
||||
|
||||
Generated
Vendored
+2
-2
@@ -31,7 +31,7 @@ spec:
|
||||
status: {}
|
||||
"schema":
|
||||
"openAPIV3Schema":
|
||||
description: "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 \n 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."
|
||||
description: "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 \n 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."
|
||||
type: object
|
||||
properties:
|
||||
apiVersion:
|
||||
@@ -154,7 +154,7 @@ spec:
|
||||
status: {}
|
||||
"schema":
|
||||
"openAPIV3Schema":
|
||||
description: "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 \n 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."
|
||||
description: "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 \n 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."
|
||||
type: object
|
||||
properties:
|
||||
apiVersion:
|
||||
|
||||
+4
-4
@@ -4,7 +4,7 @@ import (
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
)
|
||||
|
||||
//ExclusiveClusterSetLabel LabelKey
|
||||
// ExclusiveClusterSetLabel LabelKey
|
||||
const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset"
|
||||
|
||||
// +genclient
|
||||
@@ -18,9 +18,9 @@ const ClusterSetLabel = "cluster.open-cluster-management.io/clusterset"
|
||||
|
||||
// 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
|
||||
// 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.
|
||||
|
||||
Generated
Vendored
+1
-1
@@ -22,7 +22,7 @@ func (ManagedClusterSelector) SwaggerDoc() map[string]string {
|
||||
}
|
||||
|
||||
var map_ManagedClusterSet = map[string]string{
|
||||
"": "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:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn 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.",
|
||||
"": "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:\n 1. The workload can run on any ManagedCluster in the ManagedClusterSet\n 2. The workload cannot run on any ManagedCluster outside the ManagedClusterSet\n 3. The service exposed by the workload can be shared in any ManagedCluster in the ManagedClusterSet\n\nIn 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.",
|
||||
"spec": "Spec defines the attributes of the ManagedClusterSet",
|
||||
"status": "Status represents the current status of the ManagedClusterSet",
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user