You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Pasquale Congiusti <pa...@gmail.com> on 2022/04/01 07:57:45 UTC

Re: Integration resource not created with spec.replicas and unavailable to autoscaling via HPA

Hi there,
there's a bug related to that: https://github.com/apache/camel-k/issues/3132
Feel free to subscribe the GH issue to receive updates on the same.

Cheers,
Pasquale.

On Thu, Mar 31, 2022 at 6:48 PM Roberto Camelk <be...@gmail.com>
wrote:

> I created a simple integration exposing a REST endpoint.
>
> This endpoint when invoked consumes a lot of CPU (100%) for testing...
>
> I defined the traits:
> - container.limit-cpu=1000m
> - container.request-cpu=1000m
>
> After that, I created the hpa resource:
> - kubectl autoscale it my-integration-high-cpu-usage --min=1 --max=3
>
> When I started to burst the CPU with a lot of requests (testing) I
> noticed that no extra pods are created via HPA...
>
> I consulted the hpa resource with: kubectl get hpa
> my-integration-high-cpu-usage -o yaml
>
> And there was an error:
> - lastTransitionTime: "2022-03-31T16:30:07Z"
>       message: 'the HPA controller was unable to get the target''s
> current scale:
>         Internal error occurred: the spec replicas field
> ".spec.replicas" does not
>         exist'
>       reason: FailedGetScale
>       status: "False"
>       type: AbleToScale
>
> So, after that, I set the replicas in spec field with:
> - kubectl scale integrations my-integration-high-cpu-usage --replicas 1
>
> And started the stress test again... and now the HPA has done its job.
>
> My question here is, why the integration isn't created with the
> "replicas: 1" as default?
> Is There any way to define the "replicas: 1" in the integration
> resource when the kamel CLI runs it?
>