apache / camel-k

Apache Camel K is a lightweight integration platform, born on Kubernetes, with serverless superpowers
https://camel.apache.org/camel-k
Apache License 2.0
863 stars 344 forks source link

feat(#5354): Allow adding toleration into builder pod #5667

Open vkrejcirik opened 3 months ago

vkrejcirik commented 3 months ago

Closes: #5354

Release Note

feat: Allow defining tolerations for Builder pod.
squakez commented 3 months ago

BTW, also better to squash the commits into a single one in order to have a cleaner history.

squakez commented 3 months ago

Maybe some alternative approach would be to work directly on the Toleration trait, having an additional option like -t toleration.pipeline-taint=... and have all the logic encapsulated in a single place. In the same way we may rework the affinity etc.

vkrejcirik commented 3 months ago

Thanks for the work. I think it would be better to reuse the same approach we've used for Integrations' tolerations. See https://github.com/apache/camel-k/blob/main/pkg/apis/camel/v1/trait/toleration.go - you may reuse entirely the same logic. Ideally we should provide the concept of taint, and have a way to express it in the same syntax so it is easier from CLI to set via -t builder.taint=... (which should also the way we unit test it).

I was essentially following the approach from #4968 as we discussed. I like the approach of extending Toleration trait with new option for Builder pod and having the logic in a single place. So, if we are on the same page and that's what you prefer, I can look into adding this functionality there.

Thanks

squakez commented 3 months ago

I was essentially following the approach from #4968 as we discussed. I like the approach of extending Toleration trait with new option for Builder pod and having the logic in a single place. So, if we are on the same page and that's what you prefer, I can look into adding this functionality there.

Thanks

Yeah, I would have preferred that. However, I think that now we've already taken the other path, ie, the nodeselector is already on the builder trait, so, it would feel weird to require another trait for toleration. Let's keep this here for now, but try to reuse the logic already available in the other trait (ie, transforming the taints).

vkrejcirik commented 3 months ago

Okay, I will look into it.

github-actions[bot] commented 2 months ago

:warning: Unit test coverage report - coverage decreased from 40% to 39.9% (-0.1%)

squakez commented 2 months ago

Any update on this development? I'd like to understand if it may be ready to be included in 2.4.0 (https://github.com/apache/camel-k/issues/5678)

vkrejcirik commented 2 months ago

Im currently busy with our client. We are finishing project. I would like to pick up on this next or following week. I apologize for delay.

squakez commented 2 months ago

Im currently busy with our client. We are finishing project. I would like to pick up on this next or following week. I apologize for delay.

No problem, there's no hurry. I understand that if it does not make in time for 2.4 will be fine to defer for 2.5.