Skip to content

[loki] Add cooldownPeriod to defaults.kedaAutoscaling#322

Open
QuentinBisson wants to merge 3 commits intomainfrom
fix/keda-cooldown-global-default
Open

[loki] Add cooldownPeriod to defaults.kedaAutoscaling#322
QuentinBisson wants to merge 3 commits intomainfrom
fix/keda-cooldown-global-default

Conversation

@QuentinBisson
Copy link
Copy Markdown

What

Add cooldownPeriod to the shared defaults.kedaAutoscaling block and use coalesce in _keda.tpl, consistent with how pollingInterval already works.

Why

pollingInterval can be set once in defaults.kedaAutoscaling.pollingInterval to apply globally across all KEDA-enabled components. cooldownPeriod did not have this — it was hardcoded at 300s per component with no way to override globally. A user wanting to change the cooldown period had to repeat the override for every component individually.

Change

values.yaml — add to defaults.kedaAutoscaling:

cooldownPeriod: 300

_keda.tpl — use coalesce to fall back to the shared default:

- cooldownPeriod: {{ $component.kedaAutoscaling.cooldownPeriod }}
+ cooldownPeriod: {{ coalesce $component.kedaAutoscaling.cooldownPeriod .Values.defaults.kedaAutoscaling.cooldownPeriod }}

No behaviour change for existing deployments — per-component defaults remain 300s and take precedence over the shared default.

Signed-off-by: Quentin Bisson quentin.bisson@gmail.com

cooldownPeriod was not included in defaults.kedaAutoscaling, meaning it
could not be overridden globally like pollingInterval. Add it with the
same default of 300s and use coalesce in _keda.tpl so users can set a
single value in defaults.kedaAutoscaling.cooldownPeriod to apply across
all components instead of overriding each component individually.

Signed-off-by: Quentin Bisson <quentin.bisson@gmail.com>
Signed-off-by: Quentin Bisson <quentin.bisson@gmail.com>
Signed-off-by: Quentin Bisson <quentin.bisson@gmail.com>
# -- Interval (seconds) to poll each trigger. Overridable per component.
pollingInterval: 30
# -- Period (seconds) to wait after the last trigger reported active before scaling back to 0. Overridable per component.
cooldownPeriod: 300
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: is there an use case to set cooldownPeriod: 0

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To 0, apart from immédiate downscaling, not that I think of, but being able to change it makes sense. :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm asking here, if $component.kedaAutoscaling.cooldownPeriod is 0 (e.g. "empty"), then .Values.defaults.kedaAutoscaling.cooldownPeriod would be used. Thas why I use kindIs so often to check is the value is nun numeric, e.g. null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants