Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(#4958): Supporting node selectors for the builder pod #4968

Merged
merged 12 commits into from
Dec 7, 2023
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
squakez marked this conversation as resolved.
Show resolved Hide resolved
[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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is something like builder.node-selector.'size'=large, is it?

Copy link
Contributor Author

@lsergio lsergio Dec 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tested it exactly like this and it worked. I think quotes are not required as there are no spaces in the label.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, possibly in this case it works because "size" is a simple string. However, it may fail when using more complex annotations, so, better to be safe and keep the notation we're using for a map in the rest of the project.

----
2 changes: 1 addition & 1 deletion docs/modules/traits/pages/pod.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ initContainers:
command: [ "/bin/sh" , "-c", "echo 'hello'!" ]
----

The `integration` container will be overwritten by the container running the route, and the `initContainer` will run before the route as expected.
The `integration` container will be overwritten by the container running the route, and the `initContainer` will run before the route as expected.
Loading
Loading