-
Notifications
You must be signed in to change notification settings - Fork 103
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
Add support for initialCooldownPeriod On httpScaledObjects #1212
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Shay Rybak <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, thank you! Can you please also re-generate the CRDs?
make manifests
@wozniakjan added, I always forget that part. |
perfect, thank you. One more thing, can you please sign the last commit? |
Should we really do this? We could easily end up in 1-1 relation with ScaledObject's field, I wonder whether we should users encourage to specify this on the SO directly 🤔 |
Signed-off-by: Shay Rybak <[email protected]>
Signed-off-by: Shay Rybak <[email protected]>
given this can affect scaling right after |
updated.` Like I said in the issue, the use case is starting up sandbox environments so it's nice to have them up before they automatically scale down based on usage. |
Makes sense, no objections from my side. |
@@ -102,6 +102,9 @@ type HTTPScaledObjectSpec struct { | |||
// (optional) Cooldown period value | |||
// +optional | |||
CooldownPeriod *int32 `json:"scaledownPeriod,omitempty" description:"Cooldown period (seconds) for resources to scale down (Default 300)"` | |||
// (optional) Initial period before scaling | |||
// +optional | |||
InitialCooldownPeriod int32 `json:"initialCooldownPeriod,omitempty" description:"Initial period (seconds) before scaling (Default 0)"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
InitialCooldownPeriod int32 `json:"initialCooldownPeriod,omitempty" description:"Initial period (seconds) before scaling (Default 0)"` | |
InitialCooldownPeriod *int32 `json:"initialCooldownPeriod,omitempty" description:"Initial period (seconds) before scaling (Default 0)"` |
I think this is better
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change this, however the scaledObject parameter is not a pointer, which means we'll have to add a nil check.
let me know if you think it's worth.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, that was an oversight on the upstream KEDA. Let's use pointers here, I will see if I can safely change the upstream as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, that seems to be correct. In KEDA the CooldownPeriod
is a pointer while InitialCooldownPeriod
is not a pointer. I think it's because default for CooldownPeriod
is 300
and user setting 0
must be distinguishable from user not setting anything and expecting KEDA to set the default. For InitialCooldownPeriod
, the default is 0
so setting nil
would be semantically equivalent, hence no need for a pointer.
I'd actually vote for keeping the API consistent with KEDA, CooldownPeriod
as a pointer and InitialCooldownPeriod
not a pointer. But I'm easy to convince otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine either way, just let me know what to do
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tracking here: kedacore/keda#6423
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zroubalik I see the upstream was merged. should I update this one accordingly? do we want to set default values here or just pass whatever we get to the scaled object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, please also use pointer here and I think that we should keep the defaults to the core, CC @wozniakjan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, we will probably have to wait for kedacore to cut a release version we can reference with the new type. unless you want to point to a master commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've updated the code for now.
Yes. it's really useful. Yesterday I need to do a workaround to use this. I'm really excited to have this on keda. |
Just out of curiosity, what workaround that was? |
Signed-off-by: Shay Rybak <[email protected]>
Add support for initialCooldownPeriod On httpScaledObjects
Checklist
README.md
docs/
directoryFixes #1213