The paused-replicas annotation has inconsistent behavior compared to paused.
When paused=true is set, the HPA is deleted and the scale loop is stopped.
When paused-replicas=<number> is set, the HPA is first deleted but then recreated with min=max=N, and the scale loop is restarted. This causes:
- Both, the HPA and the scale executor trying to scale to N simultaneously
- A conflict at
paused-replicas=0 where the HPA is created with min=max=1 instead of the intended 0 replicas
- Switching from
paused-replicas to paused leaves a stale HPA and scale loop behind
- Errors in replica count verification are silently swallowed
Additionally, the ScaledJob pause flow does not use the status-first pattern and only stops the scale loop on the first pause, not idempotently on every reconcile.
The
paused-replicasannotation has inconsistent behavior compared topaused.When
paused=trueis set, the HPA is deleted and the scale loop is stopped.When
paused-replicas=<number>is set, the HPA is first deleted but then recreated with min=max=N, and the scale loop is restarted. This causes:paused-replicas=0where the HPA is created with min=max=1 instead of the intended 0 replicaspaused-replicastopausedleaves a stale HPA and scale loop behindAdditionally, the ScaledJob pause flow does not use the status-first pattern and only stops the scale loop on the first pause, not idempotently on every reconcile.