Interview Prep/GitOps & Argo CD/Repo Structure, Flux, Scaling & DR

How does controller sharding work?

AdvancedConceptRepo Structure, Flux, Scaling & DR
Answer

Scale the argocd-application-controller StatefulSet to N and set ARGOCD_CONTROLLER_REPLICAS=N. Each replica handles the clusters mapped to its shard. Algorithms (controller.sharding.algorithm): legacy (hash of the cluster Secret UID, can be uneven), round-robin (even distribution by ordering), consistent-hashing (even and stable as shards change). You can pin a cluster with shard: "1" in its Secret. Sharding is by cluster, so one giant cluster with thousands of apps does not benefit; then you scale processors, or split clusters across Argo CD instances.

All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on Repo Structure, Flux, Scaling & DR