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(#5354): Allow adding toleration into builder pod #5667

Closed
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 @@ -665,6 +665,13 @@ Annotation to use for the builder pod. Only used for `pod` strategy

The list of platforms used in order to build a container image.

|`tolerations` +
*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core[[\]Kubernetes core/v1.Toleration]*
|


The pod tolerations for the builder pod. Only used for `pod` strategy


|===

Expand Down Expand Up @@ -6352,6 +6359,13 @@ map[string]string

Defines a set of nodes the builder pod is eligible to be scheduled on, based on labels on the node.

|`tolerations` +
*https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.28/#toleration-v1-core[[\]Kubernetes core/v1.Toleration]*
|


Defines tolerations for the builder pod.

|`annotations` +
map[string]string
|
Expand Down
30 changes: 30 additions & 0 deletions docs/modules/traits/pages/builder.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ if you need to execute them. Useful only with `pod` strategy.
| map[string]string
| Defines a set of nodes the builder pod is eligible to be scheduled on, based on labels on the node.

| builder.tolerations
| []k8s.io/api/core/v1.Toleration
| Defines tolerations for the builder pod.

| builder.annotations
| map[string]string
| When using `pod` strategy, annotation to use for the builder pod.
Expand Down Expand Up @@ -147,3 +151,29 @@ Node selectors can be specified when running an integration with the CLI:
----
$ kamel run --trait builder.node-selector.'size'=large integration.yaml
----

== Tolerations

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

.template.yaml
[source,yaml]
----
traits:
builder:
tolerations:
- key: "key"
operator: "Equal"
value: "value"
effect: "NoSchedule"
----

The `builder` pod will be created with a toleration that allows it to run on nodes with the `key` label equal to `value` and the `effect` set to `NoSchedule`.

Tolerations can be specified when running an integration with the CLI:

[source,console]
----
$ kamel run --trait builder.tolerations.[0].key=key --trait builder.tolerations.[0].operator=Equal --trait builder.tolerations.[0].value=value --trait builder.tolerations.[0].effect=NoSchedule integration.yaml
----
402 changes: 402 additions & 0 deletions helm/camel-k/crds/crd-build.yaml

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions helm/camel-k/crds/crd-integration-kit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,48 @@ spec:
items:
type: string
type: array
tolerations:
description: Defines tolerations for the builder pod.
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified,
allowed values are NoSchedule, PreferNoSchedule and
NoExecute.
type: string
key:
description: 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.
type: string
operator:
description: Operator represents a key's relationship
to the value. Valid operators are Exists and Equal.
Defaults to Equal. Exists is equivalent to wildcard
for value, so that a pod can tolerate all taints of
a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period
of time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the
taint forever (do not evict). Zero and negative values
will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration
matches to. If the operator is Exists, the value should
be empty, otherwise just a regular string.
type: string
type: object
type: array
verbose:
description: Enable verbose logging on build components that
support it (e.g. Kaniko build pod). Deprecated no longer
Expand Down
170 changes: 170 additions & 0 deletions helm/camel-k/crds/crd-integration-platform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,49 @@ spec:
- routine
- pod
type: string
tolerations:
description: The pod tolerations for the builder pod. Only
used for `pod` strategy
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified,
allowed values are NoSchedule, PreferNoSchedule and
NoExecute.
type: string
key:
description: 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.
type: string
operator:
description: Operator represents a key's relationship
to the value. Valid operators are Exists and Equal.
Defaults to Equal. Exists is equivalent to wildcard
for value, so that a pod can tolerate all taints of
a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period
of time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the
taint forever (do not evict). Zero and negative values
will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration
matches to. If the operator is Exists, the value should
be empty, otherwise just a regular string.
type: string
type: object
type: array
toolImage:
description: The container image to be used to run the build.
type: string
Expand Down Expand Up @@ -649,6 +692,48 @@ spec:
items:
type: string
type: array
tolerations:
description: Defines tolerations for the builder pod.
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified,
allowed values are NoSchedule, PreferNoSchedule and
NoExecute.
type: string
key:
description: 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.
type: string
operator:
description: Operator represents a key's relationship
to the value. Valid operators are Exists and Equal.
Defaults to Equal. Exists is equivalent to wildcard
for value, so that a pod can tolerate all taints of
a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period
of time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the
taint forever (do not evict). Zero and negative values
will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration
matches to. If the operator is Exists, the value should
be empty, otherwise just a regular string.
type: string
type: object
type: array
verbose:
description: Enable verbose logging on build components that
support it (e.g. Kaniko build pod). Deprecated no longer
Expand Down Expand Up @@ -2139,6 +2224,49 @@ spec:
- routine
- pod
type: string
tolerations:
description: The pod tolerations for the builder pod. Only
used for `pod` strategy
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified,
allowed values are NoSchedule, PreferNoSchedule and
NoExecute.
type: string
key:
description: 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.
type: string
operator:
description: Operator represents a key's relationship
to the value. Valid operators are Exists and Equal.
Defaults to Equal. Exists is equivalent to wildcard
for value, so that a pod can tolerate all taints of
a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period
of time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the
taint forever (do not evict). Zero and negative values
will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration
matches to. If the operator is Exists, the value should
be empty, otherwise just a regular string.
type: string
type: object
type: array
toolImage:
description: The container image to be used to run the build.
type: string
Expand Down Expand Up @@ -2681,6 +2809,48 @@ spec:
items:
type: string
type: array
tolerations:
description: Defines tolerations for the builder pod.
items:
description: The pod this Toleration is attached to tolerates
any taint that matches the triple <key,value,effect> using
the matching operator <operator>.
properties:
effect:
description: Effect indicates the taint effect to match.
Empty means match all taint effects. When specified,
allowed values are NoSchedule, PreferNoSchedule and
NoExecute.
type: string
key:
description: 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.
type: string
operator:
description: Operator represents a key's relationship
to the value. Valid operators are Exists and Equal.
Defaults to Equal. Exists is equivalent to wildcard
for value, so that a pod can tolerate all taints of
a particular category.
type: string
tolerationSeconds:
description: TolerationSeconds represents the period
of time the toleration (which must be of effect NoExecute,
otherwise this field is ignored) tolerates the taint.
By default, it is not set, which means tolerate the
taint forever (do not evict). Zero and negative values
will be treated as 0 (evict immediately) by the system.
format: int64
type: integer
value:
description: Value is the taint value the toleration
matches to. If the operator is Exists, the value should
be empty, otherwise just a regular string.
type: string
type: object
type: array
verbose:
description: Enable verbose logging on build components that
support it (e.g. Kaniko build pod). Deprecated no longer
Expand Down
Loading
Loading