-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Respect to cooldownPeriod for the first deployment and let service is up and and running based on replica number for the first time. #5008
Comments
Hello, Do you see this behaviour on every CD? I mean, does this happen every time when you deploy your workload? Are your workload scaled 0 or to |
Hey , This is my configuration for keda , minimum replica is set on 0.
In other side, the replica count of deployment service is set on 1 . the deployment also has liveness and readiness probes and most of times service needs to have 3 minutes to be up and ready . This is the command that our CD is running each time when deploying the service.
When using Helm with the --atomic flag, Helm expects the service to be up and their readiness/liveness probes to pass to mark the deployment as successful. However, with KEDA set to a minReplica of 0, our service is immediately scaled down to zero replicas, even before triggers are recognized. This behavior leads Helm to assume the deployment was successful, while it's not necessery true. actually service was not up and running for even 20 seconds , it was killed by keda because the minimum replica is set on 0 . I believe, respect to cooldownPeriod and use the replica count of deployment when deploying service can be beneficial in this cases . For the moment I have to set the minimum replica to 1 to fix this issue. |
Do you mean that your helm chart always set replicas: 1? Don't you have any condition to skip this setting? Deployment manifest is idempotent, I mean, whatever you set there will be applied at least during a few seconds, if you set 1, your workload will scale to 1 until the next HPA Controller cycle. As I said, the first time when you deploy an ScaledObject this could happen, but not in the next times, and the reason behind this behavior on next times can be that you are explicitly setting |
Yes , replica is set on 1 in the deployment of service. when I set the minimum replica to 0 , after 5 seconds, the service is shutdown by keda and helm said that service is deployed successfully while it's not right!
And please consider the ScaledObject is applied by helm alongside other things like deployment ingress and service. moreover, we do use keda in our stages envs that is not under load most of times . As a result , it would be great keda use the replica of deployment as a base each time. keda still should set replica 1 when deploy service! in this case, keda can set replica 5 when re-deploy services. I can even set an annotation based on time for ScaledObject ( by help of helm ) so ScaledObject will be updated after each deploy. |
I guess that we could implement some |
Yeah, this is something we can add. Right now KEDA imidiatelly scales to minReplicas, if there's no load. |
+1. We have exactly the same requirement. KEDA should have an Imagine a deployment with prometheus as trigger (or any other pull trigger). The deployment is immediately scaled to zero and only after pull interval it will be available again.. |
I agree that implementing a cooldown period for initial scaling in KEDA is extremely beneficial, especially when using KEDA for serverless architectures. It's crucial to have a cooldown period after the first deployment, before allowing the system to scale down to zero. This cooldown would provide a stabilization phase for the system, ensuring that the service runs smoothly post-deployment before scaling down. Such a design not only enhances post-deployment stability but also aids in assessing the deployment's effectiveness before the service scales down to zero. This cooldown period is particularly important for ensuring smooth and predictable scaling behavior in serverless environments. |
Maybe we can easily fix this just honoring cooldownPeriod also in this case. I think that we check if lastActive has value, but we could just assign a default value. WDYT @kedacore/keda-core-contributors ? |
This is implementable, but probably as a new setting, to not break existing behavior? |
The bug has become into a feature? xD |
Well, it is there since the beginning 🤷♂️ 😄 I am open to discussion. |
The workaround we have in place right now since we deploy scaled objects with an operator, is to not add the idleReplicas while the scaled object creationTimestamp is less than then cooldownPeriod. |
I have a problem. When I use scaledobject to operate deployment, the cooling value configured when creating is normal. When updated, the modified cooling value will no longer take effect. The minimum value of the copy will not take effect when it is set to one, but it will work when it is zero. #5321 |
@JorTurFer Does cooldownPeriod only take effect when minReplicaCount is equal to 0? |
Yes, it only works when minReplicaCount or idleReplicaCount are zero |
@JorTurFer Hello, any plan for this fix? thanks. |
I'm not sure if there is consensus about how to fix it. @zroubalik , is a new field like Once there is a solution agreed, anyone who is willing to contribute can help with the fix |
Yeah a new field, maybe And maybe put it into |
support the proposal |
Is there any progress here? really need this feature :) thanks. |
The feature is almost ready, small changes are pending (but KubeCon has been in the middle) |
Proposal
Hey
From my understanding based on the current documentation, the cooldownPeriod in KEDA only takes effect after a scaling trigger has occurred. When initially deploying a Deployment, StatefulSet, KEDA immediately scales it to minReplicaCount, regardless of the cooldownPeriod.
It would be incredibly beneficial if the cooldownPeriod could also apply when scaling resources for the first time. Specifically, this would mean that upon deployment, the resource scales based on the defined replicas in the Deployment or StatefulSet and respects the cooldownPeriod before any subsequent scaling operations.
Use-Case
This enhancement would provide teams with a more predictable deployment behavior, especially during CI/CD processes. Ensuring that a new version of a service is stable upon deployment is critical, and this change would give teams more confidence during releases.
Is this a feature you are interested in implementing yourself?
No
Anything else?
No response
The text was updated successfully, but these errors were encountered: