Skip to content

Commit

Permalink
feat(#4958): Supporting node selectors for the builder pod (#4968)
Browse files Browse the repository at this point in the history
* feat(#4958): Supporting node selectors for the builder pod

* feat(#4958): adding nodeSelector example to the builder trait

* feat(#4958): adding unit tests

* feat(#4958): minor fix in docs

* feat(#4598): minor fix in docs

* feat(#4598): fix doc formatting

* feat(#4598): using BuildConfiguration to handle nodeSelector configuration

* feat(#4598): added cli example for the builder trait node selector

* feat(#4598): added property tag to BuilderTrait

* feat(#4598): updating generated code

* feat(#4598): updating generated code

* chore(doc): minor cli notation

---------

Co-authored-by: Pasquale Congiusti <[email protected]>
  • Loading branch information
lsergio and squakez authored Dec 7, 2023
1 parent a83c361 commit ed869f7
Show file tree
Hide file tree
Showing 24 changed files with 352 additions and 28 deletions.
54 changes: 54 additions & 0 deletions config/crd/bases/camel.apache.org_builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ spec:
description: The maximum amount of memory required. Only used
for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod. Only used
for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder Pod (must
be the same of the operator in charge of this Build reconciliation).
Expand Down Expand Up @@ -160,6 +166,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down Expand Up @@ -252,6 +264,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down Expand Up @@ -757,6 +775,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down Expand Up @@ -813,6 +837,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down Expand Up @@ -904,6 +934,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down Expand Up @@ -994,6 +1030,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down Expand Up @@ -1490,6 +1532,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down Expand Up @@ -1549,6 +1597,12 @@ spec:
description: The maximum amount of memory required.
Only used for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod.
Only used for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder
Pod (must be the same of the operator in charge of
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/camel.apache.org_integrationkits.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,12 @@ spec:
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
description: Defines a set of nodes the builder pod is eligible
to be scheduled on, based on labels on the node.
type: object
orderStrategy:
default: sequential
description: The build order strategy to use, either `dependencies`,
Expand Down
24 changes: 24 additions & 0 deletions config/crd/bases/camel.apache.org_integrationplatforms.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ spec:
description: The maximum amount of memory required. Only used
for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod. Only used
for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder Pod (must
be the same of the operator in charge of this Build reconciliation).
Expand Down Expand Up @@ -538,6 +544,12 @@ spec:
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
description: Defines a set of nodes the builder pod is eligible
to be scheduled on, based on labels on the node.
type: object
orderStrategy:
default: sequential
description: The build order strategy to use, either `dependencies`,
Expand Down Expand Up @@ -1936,6 +1948,12 @@ spec:
description: The maximum amount of memory required. Only used
for `pod` strategy
type: string
nodeSelector:
additionalProperties:
type: string
description: The node selector for the builder pod. Only used
for `pod` strategy
type: object
operatorNamespace:
description: The namespace where to run the builder Pod (must
be the same of the operator in charge of this Build reconciliation).
Expand Down Expand Up @@ -2409,6 +2427,12 @@ spec:
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
description: Defines a set of nodes the builder pod is eligible
to be scheduled on, based on labels on the node.
type: object
orderStrategy:
default: sequential
description: The build order strategy to use, either `dependencies`,
Expand Down
6 changes: 6 additions & 0 deletions config/crd/bases/camel.apache.org_integrations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6457,6 +6457,12 @@ spec:
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
description: Defines a set of nodes the builder pod is eligible
to be scheduled on, based on labels on the node.
type: object
orderStrategy:
default: sequential
description: The build order strategy to use, either `dependencies`,
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/camel.apache.org_kameletbindings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6740,6 +6740,13 @@ spec:
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
description: Defines a set of nodes the builder pod is
eligible to be scheduled on, based on labels on the
node.
type: object
orderStrategy:
default: sequential
description: The build order strategy to use, either `dependencies`,
Expand Down
7 changes: 7 additions & 0 deletions config/crd/bases/camel.apache.org_pipes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6738,6 +6738,13 @@ spec:
items:
type: string
type: array
nodeSelector:
additionalProperties:
type: string
description: Defines a set of nodes the builder pod is
eligible to be scheduled on, based on labels on the
node.
type: object
orderStrategy:
default: sequential
description: The build order strategy to use, either `dependencies`,
Expand Down
14 changes: 14 additions & 0 deletions docs/modules/ROOT/partials/apis/camel-k-crds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,13 @@ string
The maximum amount of memory required. Only used for `pod` strategy
|`nodeSelector` +
map[string]string
|
The node selector for the builder pod. Only used for `pod` strategy
|===
Expand Down Expand Up @@ -5908,6 +5915,13 @@ A list of limit cpu configuration for the specific task with format `<task-name>
A list of limit memory configuration for the specific task with format `<task-name>:<limit-memory-conf>`.
|`nodeSelector` +
map[string]string
|
Defines a set of nodes the builder pod is eligible to be scheduled on, based on labels on the node.
|===
Expand Down
27 changes: 27 additions & 0 deletions docs/modules/traits/pages/builder.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,33 @@ Syntax: [configmap\|secret]:name[/key], where name represents the resource name,
| []string
| A list of limit memory configuration for the specific task with format `<task-name>:<limit-memory-conf>`.

| builder.node-selector
| map[string]string
| Defines a set of nodes the builder pod is eligible to be scheduled on, based on labels on the node.

|===

// End of autogenerated code - DO NOT EDIT! (configuration)

== Node Selectors

With this trait you will also be able to define node selectors for the `builder` pod when using the `pod`` build strategy.
Here is a simple example:

.template.yaml
[source,yaml]
----
traits:
builder:
nodeSelector:
size: large
----

The `builder` pod will be created with a node selector that allows it to run only on nodes where the `size` label is equal to `large`.

Node selectors can be specified when running an integration with the CLI:

[source,console]
----
$ kamel run --trait builder.node-selector.'size'=large integration.groovy
----
Loading

0 comments on commit ed869f7

Please sign in to comment.