Argo CD at Scale — Sharding, Performance Tuning, Failure Modes and Mistakes

Scaling one Argo CD instance to hundreds of clusters: controller sharding, repo-server and Redis tuning, and the metrics behind stale sync status. Also the failure modes and mistakes (prunes, cascading deletes, self-heal reverts) that take production down, with recovery and guardrails.

Overview

Argo CD works out of the box for a handful of clusters. At a few hundred clusters and thousands of Applications, three things start to hurt: the application controller cannot finish a reconciliation pass before the next one is due, the repo-server runs out of memory or time generating manifests, and the Kubernetes API client throttles itself. The user-facing symptom is the same for all three: sync status that is minutes old, syncs that queue, and dashboards that disagree with the cluster.

The second class of incidents is not about scale at all. Argo CD does exactly what Git and its configuration say, quickly and everywhere. A commit that removes manifests, an Application deleted with its finalizer still on, an ApplicationSet whose generator stops matching a cluster, or a hotfix made with kubectl while self-heal is on: each is the controller working as designed against a mistake.

> [!NOTE] > Defaults below are from the current Argo CD documentation (3.x). Where a feature arrived in a specific release, the version is named. Most controller and repo-server flags shown as --flag also exist as keys in the argocd-cmd-params-cm ConfigMap.

Symptom to first command

Each symptom has a first command that tells you where to look, and a section below that explains the fix.

  • Sync status minutes old across many apps: run argocd admin cluster shards, then read Scaling the application controller.
  • One controller pod hot, others idle: run argocd admin cluster stats --sharding-method round-robin, then read Scaling the application controller.
  • Logs show 'Waited for ... due to client-side throttling': run kubectl logs -n argocd argocd-application-controller-0 | grep throttling, then read Scaling the application controller.
  • ComparisonError with 'Context deadline exceeded': run kubectl top pod -n argocd -l app.kubernetes.io/name=argocd-repo-server, then read Repo-server, Redis and monorepos.
  • Repo-server pods OOMKilled after a monorepo commit: run kubectl describe pod -n argocd -l app.kubernetes.io/name=argocd-repo-server, then read Repo-server, Redis and monorepos.
  • App OutOfSync right after a successful sync: run argocd app diff APPNAME, then read OutOfSync loops and refresh storms.
  • Application stuck deleting: run kubectl get app APPNAME -n argocd -o jsonpath='{.metadata.finalizers}', then read Stuck deletions, failing hooks and sync waves.
  • Production resources gone after a merge: run argocd app history APPNAME, then read Mistakes.

All of these limits sit somewhere on one path, from Git through the repo-server and the controller out to the spoke clusters.

Key concepts

  • Controller shard
  • Sharding algorithm
  • Status and operation processors
  • Reconciliation timeout
  • Manifest cache
  • ignoreDifferences
  • Resources finalizer
  • Prune
  • Self-heal
  • Sync window

Interview questions

  • You're running argocd centrally managing 200+ spoke clusters. The application controller is falling behind on reconciliation and applications are showing stale sync status. How do you actually scale this?
  • An engineer merged a commit that removed manifests and Argo CD auto-sync pruned production resources. How do you recover and what guardrails prevent it?
  • Why would sharding not help, even with 10 controller replicas?
  • Compare the legacy, round-robin and consistent-hashing sharding algorithms. Which would you choose?
  • Repo-server pods keep getting OOMKilled after commits to your monorepo. What do you do?
  • An Application is OutOfSync seconds after every successful sync and self-heal keeps re-syncing it. Walk through the fix.
  • An Application has been stuck deleting for an hour. What is going on and how do you clear it safely?
  • Someone deleted the parent Application in an app-of-apps setup. What happens, and how do you design so it cannot take production down?
  • During an incident an engineer ran kubectl rollout undo and the bad version came back a few seconds later. Explain and give the right procedure.
  • How do you stop an Application from deploying to the wrong cluster or namespace?

Sign up free to read the full topic

More DevOps topics

Start free on Cariara · Coding problems · System design studio