update ClusterAffinities json name

Signed-off-by: changzhen <changzhen5@huawei.com>
This commit is contained in:
changzhen 2023-02-18 11:29:18 +08:00
parent dd0f904081
commit 45340c358e
7 changed files with 538 additions and 538 deletions

View File

@ -15676,6 +15676,14 @@
"description": "Placement represents the rule for select clusters.",
"type": "object",
"properties": {
"clusterAffinities": {
"description": "ClusterAffinities represents scheduling restrictions to multiple cluster groups that indicated by ClusterAffinityTerm.\n\nThe scheduler will evaluate these groups one by one in the order they appear in the spec, the group that does not satisfy scheduling restrictions will be ignored which means all clusters in this group will not be selected unless it also belongs to the next group(a cluster could belong to multiple groups).\n\nIf none of the groups satisfy the scheduling restrictions, then scheduling fails, which means no cluster will be selected.\n\nNote:\n 1. ClusterAffinities can not co-exist with ClusterAffinity.\n 2. If both ClusterAffinity and ClusterAffinities are not set, any cluster\n can be scheduling candidates.\n\nPotential use case 1: The private clusters in the local data center could be the main group, and the managed clusters provided by cluster providers could be the secondary group. So that the Karmada scheduler would prefer to schedule workloads to the main group and the second group will only be considered in case of the main group does not satisfy restrictions(like, lack of resources).\n\nPotential use case 2: For the disaster recovery scenario, the clusters could be organized to primary and backup groups, the workloads would be scheduled to primary clusters firstly, and when primary cluster fails(like data center power off), Karmada scheduler could migrate workloads to the backup clusters.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.ClusterAffinityTerm"
}
},
"clusterAffinity": {
"description": "ClusterAffinity represents scheduling restrictions to a certain set of clusters. Note:\n 1. ClusterAffinity can not co-exist with ClusterAffinities.\n 2. If both ClusterAffinity and ClusterAffinities are not set, any cluster\n can be scheduling candidates.",
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.ClusterAffinity"
@ -15688,14 +15696,6 @@
"$ref": "#/definitions/io.k8s.api.core.v1.Toleration"
}
},
"orderedClusterAffinities": {
"description": "ClusterAffinities represents scheduling restrictions to multiple cluster groups that indicated by ClusterAffinityTerm.\n\nThe scheduler will evaluate these groups one by one in the order they appear in the spec, the group that does not satisfy scheduling restrictions will be ignored which means all clusters in this group will not be selected unless it also belongs to the next group(a cluster could belong to multiple groups).\n\nIf none of the groups satisfy the scheduling restrictions, then scheduling fails, which means no cluster will be selected.\n\nNote:\n 1. ClusterAffinities can not co-exist with ClusterAffinity.\n 2. If both ClusterAffinity and ClusterAffinities are not set, any cluster\n can be scheduling candidates.\n\nPotential use case 1: The private clusters in the local data center could be the main group, and the managed clusters provided by cluster providers could be the secondary group. So that the Karmada scheduler would prefer to schedule workloads to the main group and the second group will only be considered in case of the main group does not satisfy restrictions(like, lack of resources).\n\nPotential use case 2: For the disaster recovery scenario, the clusters could be organized to primary and backup groups, the workloads would be scheduled to primary clusters firstly, and when primary cluster fails(like data center power off), Karmada scheduler could migrate workloads to the backup clusters.",
"type": "array",
"items": {
"default": {},
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.ClusterAffinityTerm"
}
},
"replicaScheduling": {
"description": "ReplicaScheduling represents the scheduling policy on dealing with the number of replicas when propagating resources that have replicas in spec (e.g. deployments, statefulsets) to member clusters.",
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.policy.v1alpha1.ReplicaSchedulingStrategy"

View File

@ -65,6 +65,138 @@ spec:
description: Placement represents the rule for select clusters to
propagate resources.
properties:
clusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
clusterAffinity:
description: 'ClusterAffinity represents scheduling restrictions
to a certain set of clusters. Note: 1. ClusterAffinity can not
@ -211,138 +343,6 @@ spec:
type: string
type: object
type: array
orderedClusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
replicaScheduling:
description: ReplicaScheduling represents the scheduling policy
on dealing with the number of replicas when propagating resources

View File

@ -61,6 +61,138 @@ spec:
description: Placement represents the rule for select clusters to
propagate resources.
properties:
clusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
clusterAffinity:
description: 'ClusterAffinity represents scheduling restrictions
to a certain set of clusters. Note: 1. ClusterAffinity can not
@ -207,138 +339,6 @@ spec:
type: string
type: object
type: array
orderedClusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
replicaScheduling:
description: ReplicaScheduling represents the scheduling policy
on dealing with the number of replicas when propagating resources

View File

@ -328,6 +328,138 @@ spec:
description: Placement represents the rule for select clusters to
propagate resources.
properties:
clusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
clusterAffinity:
description: 'ClusterAffinity represents scheduling restrictions
to a certain set of clusters. Note: 1. ClusterAffinity can not
@ -474,138 +606,6 @@ spec:
type: string
type: object
type: array
orderedClusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
replicaScheduling:
description: ReplicaScheduling represents the scheduling policy
on dealing with the number of replicas when propagating resources

View File

@ -328,6 +328,138 @@ spec:
description: Placement represents the rule for select clusters to
propagate resources.
properties:
clusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
clusterAffinity:
description: 'ClusterAffinity represents scheduling restrictions
to a certain set of clusters. Note: 1. ClusterAffinity can not
@ -474,138 +606,6 @@ spec:
type: string
type: object
type: array
orderedClusterAffinities:
description: "ClusterAffinities represents scheduling restrictions
to multiple cluster groups that indicated by ClusterAffinityTerm.
\n The scheduler will evaluate these groups one by one in the
order they appear in the spec, the group that does not satisfy
scheduling restrictions will be ignored which means all clusters
in this group will not be selected unless it also belongs to
the next group(a cluster could belong to multiple groups). \n
If none of the groups satisfy the scheduling restrictions, then
scheduling fails, which means no cluster will be selected. \n
Note: 1. ClusterAffinities can not co-exist with ClusterAffinity.
2. If both ClusterAffinity and ClusterAffinities are not set,
any cluster can be scheduling candidates. \n Potential use case
1: The private clusters in the local data center could be the
main group, and the managed clusters provided by cluster providers
could be the secondary group. So that the Karmada scheduler
would prefer to schedule workloads to the main group and the
second group will only be considered in case of the main group
does not satisfy restrictions(like, lack of resources). \n Potential
use case 2: For the disaster recovery scenario, the clusters
could be organized to primary and backup groups, the workloads
would be scheduled to primary clusters firstly, and when primary
cluster fails(like data center power off), Karmada scheduler
could migrate workloads to the backup clusters."
items:
description: ClusterAffinityTerm selects a set of cluster.
properties:
affinityName:
description: AffinityName is the name of the cluster group.
type: string
clusterNames:
description: ClusterNames is the list of clusters to be
selected.
items:
type: string
type: array
exclude:
description: ExcludedClusters is the list of clusters to
be ignored.
items:
type: string
type: array
fieldSelector:
description: FieldSelector is a filter to select member
clusters by fields. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: A list of field selector requirements.
items:
description: A node selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: The label key that the selector applies
to.
type: string
operator:
description: Represents a key's relationship to
a set of values. Valid operators are In, NotIn,
Exists, DoesNotExist. Gt, and Lt.
type: string
values:
description: An array of string values. If the
operator is In or NotIn, the values array must
be non-empty. If the operator is Exists or DoesNotExist,
the values array must be empty. If the operator
is Gt or Lt, the values array must have a single
element, which will be interpreted as an integer.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
type: object
labelSelector:
description: LabelSelector is a filter to select member
clusters by labels. If non-nil and non-empty, only the
clusters match this filter will be selected.
properties:
matchExpressions:
description: matchExpressions is a list of label selector
requirements. The requirements are ANDed.
items:
description: A label selector requirement is a selector
that contains values, a key, and an operator that
relates the key and values.
properties:
key:
description: key is the label key that the selector
applies to.
type: string
operator:
description: operator represents a key's relationship
to a set of values. Valid operators are In,
NotIn, Exists and DoesNotExist.
type: string
values:
description: values is an array of string values.
If the operator is In or NotIn, the values array
must be non-empty. If the operator is Exists
or DoesNotExist, the values array must be empty.
This array is replaced during a strategic merge
patch.
items:
type: string
type: array
required:
- key
- operator
type: object
type: array
matchLabels:
additionalProperties:
type: string
description: matchLabels is a map of {key,value} pairs.
A single {key,value} in the matchLabels map is equivalent
to an element of matchExpressions, whose key field
is "key", the operator is "In", and the values array
contains only "value". The requirements are ANDed.
type: object
type: object
required:
- affinityName
type: object
type: array
replicaScheduling:
description: ReplicaScheduling represents the scheduling policy
on dealing with the number of replicas when propagating resources

View File

@ -184,7 +184,7 @@ type Placement struct {
// Karmada scheduler could migrate workloads to the backup clusters.
//
// +optional
ClusterAffinities []ClusterAffinityTerm `json:"orderedClusterAffinities,omitempty"`
ClusterAffinities []ClusterAffinityTerm `json:"clusterAffinities,omitempty"`
// ClusterTolerations represents the tolerations.
// +optional

View File

@ -3186,7 +3186,7 @@ func schema_pkg_apis_policy_v1alpha1_Placement(ref common.ReferenceCallback) com
Ref: ref("github.com/karmada-io/karmada/pkg/apis/policy/v1alpha1.ClusterAffinity"),
},
},
"orderedClusterAffinities": {
"clusterAffinities": {
SchemaProps: spec.SchemaProps{
Description: "ClusterAffinities represents scheduling restrictions to multiple cluster groups that indicated by ClusterAffinityTerm.\n\nThe scheduler will evaluate these groups one by one in the order they appear in the spec, the group that does not satisfy scheduling restrictions will be ignored which means all clusters in this group will not be selected unless it also belongs to the next group(a cluster could belong to multiple groups).\n\nIf none of the groups satisfy the scheduling restrictions, then scheduling fails, which means no cluster will be selected.\n\nNote:\n 1. ClusterAffinities can not co-exist with ClusterAffinity.\n 2. If both ClusterAffinity and ClusterAffinities are not set, any cluster\n can be scheduling candidates.\n\nPotential use case 1: The private clusters in the local data center could be the main group, and the managed clusters provided by cluster providers could be the secondary group. So that the Karmada scheduler would prefer to schedule workloads to the main group and the second group will only be considered in case of the main group does not satisfy restrictions(like, lack of resources).\n\nPotential use case 2: For the disaster recovery scenario, the clusters could be organized to primary and backup groups, the workloads would be scheduled to primary clusters firstly, and when primary cluster fails(like data center power off), Karmada scheduler could migrate workloads to the backup clusters.",
Type: []string{"array"},