fix: don't trigger scale-down if already at min replicas

checkAndScale was deciding to scale-down based on avgLoad without checking
if already at minimum replicas. This caused unnecessary scale-down attempts
that would fail and log noise.

Add check: only scale-down if instances.size > scaleMinReplicas

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 23:33:20 +02:00
parent 1d121c727c
commit 4b3b5e7c4e
@@ -81,7 +81,7 @@ class AutoScaler:
avgLoadRef.set(avgLoad)
if avgLoad > config.scaleUpThreshold * config.maxGamesPerCore then scaleUp()
else if avgLoad < config.scaleDownThreshold * config.maxGamesPerCore then scaleDown()
else if avgLoad < config.scaleDownThreshold * config.maxGamesPerCore && instances.size > config.scaleMinReplicas then scaleDown()
def scaleUp(): Unit =
log.info("Scaling up Argo Rollout")