Why can an old ReplicaSet scale up when the image and replica count change together?

I would like to understand the Deployment controller’s behavior when scaling up and changing the container image in the same release.

In a RollingUpdate Deployment, we changed the desired replica count from 1 to 2 while updating the image from v1 to v2. During the rollout, we observed an additional old-version Pod being created, even though that version was about to be replaced.

The release was applied through Argo CD using Helm-rendered manifests. We have not yet verified whether the API server received the image and replica changes in a single update or whether reconciliation produced multiple updates, so I am not claiming this is a Kubernetes bug or presenting a confirmed minimal reproduction.

I am aware of the documented proportional-scaling behavior, which spreads additional replicas across active ReplicaSets during a rollout to mitigate risk:

My questions are:

  1. Is scaling up the old ReplicaSet expected when the Pod template and replica count change in a single Deployment update, or does it indicate that scaling and the image update were processed separately?
  2. Could additional replicas preferentially use the new Pod template while still satisfying maxUnavailable and maxSurge? What availability or rollout risks does the existing behavior protect against?
  3. Is there an existing configuration or design discussion about reducing this short-lived old-version Pod creation? For slow-starting or resource-heavy applications, pulling and initializing an old image that is immediately retired can add noticeable resource use and rollout time.
  4. Which Deployment/ReplicaSet events or controller details would best distinguish proportional scaling from separate GitOps updates?

I am asking about the design tradeoff and how to collect a useful minimal reproduction before opening an enhancement issue. Thank you.

When a Deployment receives a patch that simultaneously increases .spec.replicas and updates .spec.template (e.g. changing the container image), the Deployment controller runs its scaling reconciliation pass (syncScaling) before rolling out the new template (rolloutRolling) if total current pods across all ReplicaSets do not match the new .spec.replicas target.

In pkg/controller/deployment/rolling.go (scale()), Kubernetes computes proportional scaling across active ReplicaSets so total available capacity immediately matches the new desired replica count before maxSurge / maxUnavailable rolling replacement begins. If the new ReplicaSet has 0 ready pods on the first reconcile tick, proportional scaling momentarily assigns the delta to the existing ReplicaSet until the new ReplicaSet is created and scaled up on the next tick.

If you want zero transient scale-up on the old ReplicaSet during combined image + replica updates, apply the image bump first (or set maxSurge high enough to absorb the new target directly) before raising .spec.replicas.

This is normal Kubernetes behavior. During a RollingUpdate, some Pods may still use the old image. This is called proportional scaling. Check with kubectl get rs -w and wait for the rollout to finish before increasing replicas.

Checking the output right after that step on Why can an old ReplicaSet scale up when the imag confirms whether the parameter bound cleanly. Hope that resolves the blocker.