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
848 stars 345 forks source link

Integration scale subresource not working with Knative trait enabled #3656

Open christophd opened 1 year ago

christophd commented 1 year ago

The Camel K integration custom resource enables the scale subresource in order to provide auto scaling and resource scaling e.g. via using the kubectl scale command

As soon as the Knative trait is enabled and the Integration uses a Knative service on top of the Deployment this scaling mechanism is not working anymore.

The result of scaling the Integration custom resource is a new revision of the Knative service instead of a proper scaling.

Reproduced with Camel K 1.10.x

christophd commented 1 year ago

@squakez @astefanutti FYI

squakez commented 1 year ago

Thanks for reporting. I am not sure if that is kind of expected. I mean, when we set a knative service trait, it would be supposed the user to scale via the trait as well.

tadayosi commented 1 year ago

It sounds similar to the discussion raised at #3132.

astefanutti commented 1 year ago

The current logic forces Knative auto-scaling to comply with the user-provided replicas count, by explicitly setting the autoscaling.knative.dev/minScale and autoscaling.knative.dev/maxScale annotations to be equal to the specified replicas count.

This logic has been implemented a long time ago, even before KEDA came out, and I don't think there is an e2e test for it. So it's possible it does not behave correctly anymore.

That being said, following the discussions from #2838 and #3132, I'm starting to think that approach may not be correct, and incompatible with auto-scaler implementations. In practice, it seems they make the assumption they own the control of the scale sub-resource, which is probably a fair assumption, even from the end-user standpoint, as @squakez pointed out. So in that spirit, an option could be to remove the obsolete logic and document that auto-scaling and manual scaling are mutually exclusive.

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale due to 90 days of inactivity. It will be closed if no further activity occurs within 15 days. If you think that’s incorrect or the issue should never stale, please simply write any comment. Thanks for your contributions!