Skip to content

Commit 8a47754

Browse files
committed
Introduce components fields to ResourceBinding API.
Signed-off-by: RainbowMango <[email protected]>
1 parent b1ea332 commit 8a47754

File tree

8 files changed

+533
-3
lines changed

8 files changed

+533
-3
lines changed

api/openapi-spec/swagger.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21176,6 +21176,29 @@
2117621176
}
2117721177
]
2117821178
},
21179+
"com.github.karmada-io.karmada.pkg.apis.work.v1alpha2.ComponentRequirements": {
21180+
"description": "ComponentRequirements represents the requirements for a specific component.",
21181+
"type": "object",
21182+
"required": [
21183+
"replicas"
21184+
],
21185+
"properties": {
21186+
"name": {
21187+
"description": "Name of this component. It is required when the resource contains multiple components to ensure proper identification, and must also be unique within the same resource.",
21188+
"type": "string"
21189+
},
21190+
"replicaRequirements": {
21191+
"description": "ReplicaRequirements represents the requirements required by each replica for this component.",
21192+
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.work.v1alpha2.ReplicaRequirements"
21193+
},
21194+
"replicas": {
21195+
"description": "Replicas represents the replica number of the resource's component.",
21196+
"type": "integer",
21197+
"format": "int32",
21198+
"default": 0
21199+
}
21200+
}
21201+
},
2117921202
"com.github.karmada-io.karmada.pkg.apis.work.v1alpha2.GracefulEvictionTask": {
2118021203
"description": "GracefulEvictionTask represents a graceful eviction task.",
2118121204
"type": "object",
@@ -21422,6 +21445,14 @@
2142221445
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.work.v1alpha2.TargetCluster"
2142321446
}
2142421447
},
21448+
"components": {
21449+
"description": "Components represents the requirements of multiple pod templates of the referencing resource. It is designed to support workloads that consist of multiple pod templates, such as distributed training jobs (e.g., PyTorch, TensorFlow) and big data workloads (e.g., FlinkDeployment), where each workload is composed of more than one pod template. It is also capable of representing single-component workloads, such as Deployment.\n\nNote: This field is intended to replace the legacy ReplicaRequirements and Replicas fields above. It is only populated when the MultiplePodTemplatesScheduling feature gate is enabled.",
21450+
"type": "array",
21451+
"items": {
21452+
"default": {},
21453+
"$ref": "#/definitions/com.github.karmada-io.karmada.pkg.apis.work.v1alpha2.ComponentRequirements"
21454+
}
21455+
},
2142521456
"conflictResolution": {
2142621457
"description": "ConflictResolution declares how potential conflict should be handled when a resource that is being propagated already exists in the target cluster.\n\nIt defaults to \"Abort\" which means stop propagating to avoid unexpected overwrites. The \"Overwrite\" might be useful when migrating legacy cluster resources to Karmada, in which case conflict is predictable and can be instructed to Karmada take over the resource by overwriting.",
2142721458
"type": "string"

charts/karmada/_crds/bases/work/work.karmada.io_clusterresourcebindings.yaml

Lines changed: 195 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,201 @@ spec:
261261
- name
262262
type: object
263263
type: array
264+
components:
265+
description: |-
266+
Components represents the requirements of multiple pod templates of the referencing resource.
267+
It is designed to support workloads that consist of multiple pod templates,
268+
such as distributed training jobs (e.g., PyTorch, TensorFlow) and big data workloads (e.g., FlinkDeployment),
269+
where each workload is composed of more than one pod template. It is also capable of representing
270+
single-component workloads, such as Deployment.
271+
272+
Note: This field is intended to replace the legacy ReplicaRequirements and Replicas fields above.
273+
It is only populated when the MultiplePodTemplatesScheduling feature gate is enabled.
274+
items:
275+
description: ComponentRequirements represents the requirements for
276+
a specific component.
277+
properties:
278+
name:
279+
description: |-
280+
Name of this component.
281+
It is required when the resource contains multiple components to ensure proper identification,
282+
and must also be unique within the same resource.
283+
maxLength: 32
284+
type: string
285+
replicaRequirements:
286+
description: ReplicaRequirements represents the requirements
287+
required by each replica for this component.
288+
properties:
289+
namespace:
290+
description: Namespace represents the resources namespaces
291+
type: string
292+
nodeClaim:
293+
description: NodeClaim represents the node claim HardNodeAffinity,
294+
NodeSelector and Tolerations required by each replica.
295+
properties:
296+
hardNodeAffinity:
297+
description: |-
298+
A node selector represents the union of the results of one or more label queries over a set of
299+
nodes; that is, it represents the OR of the selectors represented by the node selector terms.
300+
Note that only PodSpec.Affinity.NodeAffinity.RequiredDuringSchedulingIgnoredDuringExecution
301+
is included here because it has a hard limit on pod scheduling.
302+
properties:
303+
nodeSelectorTerms:
304+
description: Required. A list of node selector terms.
305+
The terms are ORed.
306+
items:
307+
description: |-
308+
A null or empty node selector term matches no objects. The requirements of
309+
them are ANDed.
310+
The TopologySelectorTerm type implements a subset of the NodeSelectorTerm.
311+
properties:
312+
matchExpressions:
313+
description: A list of node selector requirements
314+
by node's labels.
315+
items:
316+
description: |-
317+
A node selector requirement is a selector that contains values, a key, and an operator
318+
that relates the key and values.
319+
properties:
320+
key:
321+
description: The label key that the
322+
selector applies to.
323+
type: string
324+
operator:
325+
description: |-
326+
Represents a key's relationship to a set of values.
327+
Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
328+
type: string
329+
values:
330+
description: |-
331+
An array of string values. If the operator is In or NotIn,
332+
the values array must be non-empty. If the operator is Exists or DoesNotExist,
333+
the values array must be empty. If the operator is Gt or Lt, the values
334+
array must have a single element, which will be interpreted as an integer.
335+
This array is replaced during a strategic merge patch.
336+
items:
337+
type: string
338+
type: array
339+
x-kubernetes-list-type: atomic
340+
required:
341+
- key
342+
- operator
343+
type: object
344+
type: array
345+
x-kubernetes-list-type: atomic
346+
matchFields:
347+
description: A list of node selector requirements
348+
by node's fields.
349+
items:
350+
description: |-
351+
A node selector requirement is a selector that contains values, a key, and an operator
352+
that relates the key and values.
353+
properties:
354+
key:
355+
description: The label key that the
356+
selector applies to.
357+
type: string
358+
operator:
359+
description: |-
360+
Represents a key's relationship to a set of values.
361+
Valid operators are In, NotIn, Exists, DoesNotExist. Gt, and Lt.
362+
type: string
363+
values:
364+
description: |-
365+
An array of string values. If the operator is In or NotIn,
366+
the values array must be non-empty. If the operator is Exists or DoesNotExist,
367+
the values array must be empty. If the operator is Gt or Lt, the values
368+
array must have a single element, which will be interpreted as an integer.
369+
This array is replaced during a strategic merge patch.
370+
items:
371+
type: string
372+
type: array
373+
x-kubernetes-list-type: atomic
374+
required:
375+
- key
376+
- operator
377+
type: object
378+
type: array
379+
x-kubernetes-list-type: atomic
380+
type: object
381+
x-kubernetes-map-type: atomic
382+
type: array
383+
x-kubernetes-list-type: atomic
384+
required:
385+
- nodeSelectorTerms
386+
type: object
387+
x-kubernetes-map-type: atomic
388+
nodeSelector:
389+
additionalProperties:
390+
type: string
391+
description: |-
392+
NodeSelector is a selector which must be true for the pod to fit on a node.
393+
Selector which must match a node's labels for the pod to be scheduled on that node.
394+
type: object
395+
tolerations:
396+
description: If specified, the pod's tolerations.
397+
items:
398+
description: |-
399+
The pod this Toleration is attached to tolerates any taint that matches
400+
the triple <key,value,effect> using the matching operator <operator>.
401+
properties:
402+
effect:
403+
description: |-
404+
Effect indicates the taint effect to match. Empty means match all taint effects.
405+
When specified, allowed values are NoSchedule, PreferNoSchedule and NoExecute.
406+
type: string
407+
key:
408+
description: |-
409+
Key is the taint key that the toleration applies to. Empty means match all taint keys.
410+
If the key is empty, operator must be Exists; this combination means to match all values and all keys.
411+
type: string
412+
operator:
413+
description: |-
414+
Operator represents a key's relationship to the value.
415+
Valid operators are Exists and Equal. Defaults to Equal.
416+
Exists is equivalent to wildcard for value, so that a pod can
417+
tolerate all taints of a particular category.
418+
type: string
419+
tolerationSeconds:
420+
description: |-
421+
TolerationSeconds represents the period of time the toleration (which must be
422+
of effect NoExecute, otherwise this field is ignored) tolerates the taint. By default,
423+
it is not set, which means tolerate the taint forever (do not evict). Zero and
424+
negative values will be treated as 0 (evict immediately) by the system.
425+
format: int64
426+
type: integer
427+
value:
428+
description: |-
429+
Value is the taint value the toleration matches to.
430+
If the operator is Exists, the value should be empty, otherwise just a regular string.
431+
type: string
432+
type: object
433+
type: array
434+
type: object
435+
priorityClassName:
436+
description: PriorityClassName represents the resources
437+
priorityClassName
438+
type: string
439+
resourceRequest:
440+
additionalProperties:
441+
anyOf:
442+
- type: integer
443+
- type: string
444+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
445+
x-kubernetes-int-or-string: true
446+
description: ResourceRequest represents the resources required
447+
by each replica.
448+
type: object
449+
type: object
450+
replicas:
451+
description: Replicas represents the replica number of the resource's
452+
component.
453+
format: int32
454+
type: integer
455+
required:
456+
- replicas
457+
type: object
458+
type: array
264459
conflictResolution:
265460
default: Abort
266461
description: |-

0 commit comments

Comments
 (0)