A GitOps controller and an autoscaler are both reconciliation loops. Each one reads the state of a workload, compares it with what it wants, and writes the difference. Point both of them at the same field and they do not cooperate. Whichever wrote last wins, until the other one runs again.
The field they most often share is the replica count. The Horizontal Pod Autoscaler sets it from load. The deployment tool sets it from Git. On a quiet day the fight is invisible, because the two values are close. On the wrong day the deployment tool holds a service at its minimum while load climbs, and the autoscaler loses every round.
Spotify published an account of exactly this in November 2026, from an outage on 29 September that stopped people logging in. The position here is the one their report supports: every field on a live workload needs exactly one owner, the replica count belongs to the autoscaler, and the deployment tool has to be prevented from writing it in a way that survives every sync and every workload type.
How a replica count gets two owners
The autoscaler does not create pods itself. It writes a desired count to the workload’s spec.replicas
field through the scale subresource, and the workload’s controller does the rest. That holds for a
Kubernetes Deployment and, as the Argo Rollouts documentation describes, for an Argo Rollout, which
exposes the same subresource so that the autoscaler can drive it.
The deployment tool’s job is to make the live object match the manifest in Git. If that manifest
carries a replicas: value, the tool considers it part of the desired state and applies it. With
self-heal turned on in Argo CD, it does not wait for a commit: drift in the live object is itself a
reason to sync again.
- Rule
- one owner per field; replicas belong to the autoscaler
- Fix
- leave replicas out of Git, or exclude it from sync per kind
- Not a fix
- excluding it from the diff alone
This diagram as text
- Manifest in Git — replicas: 3
- Argo CD — applies Git on sync
- Workload Deployment or Rollout
- spec.replicas — one field
- Pods — as many as it says
- Autoscaler — HPA, from load
Relationships
- Manifest in Git → Argo CD — desired
- Argo CD → spec.replicas — writes
- Autoscaler → spec.replicas — writes
- spec.replicas → Pods
The Kubernetes documentation is direct about the outcome. When an autoscaler is active and the
manifest still sets spec.replicas, every apply instructs Kubernetes to scale to that value, which
produces thrashing. The recommended fix is to remove the field from the manifest.
A field with two writers belongs to whichever ran most recently.
Hiding the difference is not the same as not writing it
Most teams meet this problem first as a cosmetic one. The autoscaler changes the count, the GitOps
dashboard shows the application as out of sync, and someone adds an exclusion so the warning goes
away. In Argo CD that is ignoreDifferences on /spec/replicas.
That exclusion does less than it appears to. Argo CD’s documentation states that by default it is used
only to compute the diff that decides whether an application is in sync. During the sync itself, the
desired state is applied as it is. The dashboard turns green while every sync still carries the value
from Git. To make a sync leave the field alone, the application needs the RespectIgnoreDifferences=true
sync option as well, and even then it applies only to resources that already exist in the cluster.
There is a second trap in the same rule. An exclusion is keyed by API group and kind. A rule written
for apps/Deployment says nothing about a Rollout, which lives in the argoproj.io group. Spotify’s
report describes the shape of their failure in these terms: one change moved workloads from Kubernetes
Deployments to Argo Rollouts, a second changed which fields were excluded from the automated diff, and
together they put the replica field back in scope. On every sync, the deployment system then set the
count to the minimum. It happened only for services that used Rollouts and also had a test
environment, which is why neither change failed on its own.
Taken together, the options rank like this:
| Approach | What it does | What you are accepting |
|---|---|---|
Leave replicas out of Git |
The deployment tool has nothing to write, so the autoscaler is the only owner | A one-off migration done carefully, and charts that must not render a default |
| Exclude the field from sync | ignoreDifferences plus RespectIgnoreDifferences=true, per kind |
A rule that must list every workload kind, including any added later |
| Exclude the field from the diff only | The dashboard stops reporting drift | Nothing is fixed; each sync still overwrites the autoscaler |
Leaving the field out is the durable answer because it does not depend on a rule keeping up with the
platform. It has one hazard of its own. The Kubernetes documentation warns that removing spec.replicas
can cause a one-time drop to the default of one replica, because the next apply treats the field as
deleted. The documented migration removes the field from the last applied configuration first and from
the manifest second. Done in the other order on a busy service, the fix becomes the outage.
The floor is the capacity you recover with
The deployment tool did not set Spotify’s replica count to zero. It set it to the minimum. The report lists, as a contributing factor in its own right, that the login service’s minimum replica count was too low to protect it against downscaling.
That minimum matters most at the worst moment. When an authentication service fails, every client’s session or token lapses, and they all come back together when it recovers. Spotify notes that client backoff did not prevent the surge: at the start of recovery the login system handled two hundred times the traffic it carried before the incident. The surviving instances were overwhelmed, the faulty loop kept lowering the count, and the service failed instead of scaling out. Responders later gave the login service three times its normal CPU and memory to absorb the returning herd.
Set the floor from the load the service must survive when it comes back, not from the quietest hour of the week. That is capacity with a stated job, which is different from the reserved and unused capacity discussed in autoscaling that actually reduces the bill. The same dynamic, with a circuit breaker instead of a sync loop holding the fleet small, is the subject of when the circuit breaker will not stay closed.
Recovery also moves the problem downstream. In one of Spotify’s European regions, the flood of returning apps overwhelmed the services behind authentication after login itself had recovered, and full recovery took about three more hours than elsewhere. Those services had scaled down during the outage too. A recovery plan for a front-door service has to name the dependencies that scale with it.
Automation that fights the responder
Reconciliation is a good property until the desired state is wrong. Then the tool that keeps the estate correct keeps putting the fault back. Spotify’s report says their automation reapplied the faulty configuration and slowed manual recovery, and one of their changes since is a simpler way for responders to pause it.
Decide in advance how a responder pauses sync for a single application, and write it into the runbook. In Argo CD the controls are automated sync and self-heal on the application. There is a catch worth finding in a rehearsal rather than an incident: for an application generated by an ApplicationSet, the documentation states that changing the application’s own sync policy has no effect, so the pause has to be made through the ApplicationSet. A responder who edits the generated application, sees nothing change, and concludes the fix is wrong has lost time to a documented behaviour.
Pausing is a change in its own right. Record who paused what, and make resuming sync an explicit step in closing the incident, or the estate drifts silently from Git for weeks.
Two changes that pass alone and fail together
Neither of Spotify’s changes was untested. Each was tested independently, and the conflict existed only in the combination. Their test environment also differed from production by design, running fewer instances and omitting some automated health checks, so a rule derived from testing behaved differently once applied to production workloads.
Three checks catch this class of change before it ships, and none of them needs a large platform team:
- Render and compare. Render the manifests for every environment before and after a change to the deployment tooling, and fail the pipeline if any field owned by another controller appears in the output. The replica count of an autoscaled workload is the obvious one.
- Enforce the rule at admission. A policy that rejects a manifest setting
replicason a workload targeted by an autoscaler turns a convention into a gate. An admission controller such as Kyverno or Gatekeeper can express it. - Watch the count, not only the errors. An alert on a replica count that is falling while request rate or latency rises catches the fight directly, minutes before the error rate does.
Spotify also found that overloaded services under-reported their own traffic, because requests dropped early by load shedding never reached the metrics. They charted the incident from 5xx responses at the perimeter instead. Measure load where it enters, so the number does not fall precisely when the service is drowning.
How STP approaches this
When we review a Kubernetes platform, we compare what the GitOps tool applies with what the autoscaler writes, workload kind by workload kind, and check that each field has one owner in the sync itself and not only in the dashboard. We then look at the replica floors of the services clients cannot work without, and rehearse pausing sync for one application before it is needed in an incident.
More on Kubernetes platforms and DevOps, or start a conversation.

