You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
KPA should support gang workloads whose valid replica states are:
replicas == 0, or replicas >= minCount
Actual Behavior
KPA gradually scales 2 -> 1 -> 0. With the default MaxScaleDownRate=2:
Ready=2, metricDesired=0
desired=floor(2/2)=1
A gang workload with minCount=2 cannot realize one replica, so it remains at
two. KPA continues observing two Ready Pods and repeatedly requests one,
preventing scale-to-zero:
KPA requests 1 -> target remains at 2 -> repeat
Pods remain stable, but KPA desired remains 1, actual remains 2, and a
persistent write loop occurs. A control allowing one replica successfully
converges through 2 -> 1 -> 0.
Related behavior is discussed in #14017 and #15154.
KEDA avoids this using separate idle and active floors:
When KPA calculates desired scale-down for gang-scheduled workloads where valid replica states are 0 or >= minCount, gradual step-down (e.g. 2 -> 1 with default MaxScaleDownRate) creates a deadlock where 1 replica cannot be realized, preventing scale-to-zero. I can look into KPA's scaling calculation in pkg/autoscaler/scaling to properly account for minCount boundaries during scale-down decisions so gang workloads can cleanly scale to zero, and add test cases.
Activity
webdevsamran commentedon Sep 6, 2026
Hi team, I would like to work on this issue.
When KPA calculates desired scale-down for gang-scheduled workloads where valid replica states are
0or>= minCount, gradual step-down (e.g. 2 -> 1 with default MaxScaleDownRate) creates a deadlock where 1 replica cannot be realized, preventing scale-to-zero. I can look into KPA's scaling calculation inpkg/autoscaler/scalingto properly account forminCountboundaries during scale-down decisions so gang workloads can cleanly scale to zero, and add test cases.Could you please assign this to me? Thanks!