FEAT: support idleReplicaCount=0 rendering in Rollout Deployment KEDA template#6972
FEAT: support idleReplicaCount=0 rendering in Rollout Deployment KEDA template#6972lokesh-devtron wants to merge 4 commits into
Conversation
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
| cooldownPeriod: 300 # Optional. Default: 300 seconds | ||
| minReplicaCount: 1 | ||
| maxReplicaCount: 2 | ||
| idleReplicaCount: 0 |
There was a problem hiding this comment.
@lokesh-devtron Why are we including idleReplicaCount: 0 in default values?
@YashasviDevtron previously removed it to fix an issue, can you please verify #6729 once?
There was a problem hiding this comment.
@lokesh-devtron idleReplicaCount: 0 was hardcoded into the chart's default values.yaml, so it showed up in every KEDA app's ScaledObject even if the user didn't configure it , meaning pods could get scaled down below minReplicaCount even when user nerver wanted that. That's a problem because it quietly changes behavior: it lets KEDA scale a workload all the way down to zero pods when idle, even for apps that assumed minReplicaCount was a hard floor they'd never drop below, leading to unnecessary downscaling.
There was a problem hiding this comment.
if the user didn't configure any idleReplicaCount value, it should work purely on minReplicaCount/maxReplicaCount, not silently pick up idleReplicaCount on its own. Removing it from the defaults fixed that, if it's not set, it's just not there, so the manifest skips it and apps go back to their normal min/max replica behavior.
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
…ts and chart versions
|
Some linked issues are invalid. Please update the issue links:\nIssue # in is not found or invalid (HTTP }404).\n |
|
|
Hi @prakarsh-dt I discussed this with @YashasviDevtron and verified the previous change. Based on the feedback, I have removed the default idleReplicaCount from the values.yaml files across all affected charts. The template change ({{- if ne $.Values.kedaAutoscaling.idleReplicaCount nil }}) has been retained, so idleReplicaCount will now be rendered only when it is explicitly configured by the user through values/overrides, while preserving the existing default behavior. Kindly review the updated changes. Thanks! |



Type of change
Description
Problem Statement
When
kedaAutoscaling.idleReplicaCountis configured with the value0, the generated KEDAScaledObjectdoes not render theidleReplicaCountfield.The existing Helm template uses the following condition:
Since Helm evaluates
0as a false value, the condition fails and the field is omitted from the rendered manifest.As a result, users cannot explicitly configure:
even when it is provided in the deployment template values.
Root Cause
The template checks the truthiness of the value instead of checking whether the value is defined.
Fix
Updated the template condition to explicitly check for
nil:This ensures that:
idleReplicaCount: 0is rendered correctly.Additionally, added the default
idleReplicaCount: 0invalues.yamlfor consistency.Testing
when configured in values.
Impact
This change preserves existing behavior while correctly supporting explicit zero values for
idleReplicaCount.Summary by Bito