TL; DR: I merged a few ArgoCD clusters together into a central
ArgoCD last week, just to have 1 ArgoCD to manage multiple GKE clusters. Obviously this will cause some performance issue – the more apps I have, the longer it takes to refresh in ArgoCD. Here’s a simple way to scale it up.
# strategic merge patch for application controller apiVersion: apps/v1 kind: StatefulSet metadata: name: argocd-application-controller spec: # 2 replicas instead of 1 replicas: 2 template: spec: containers: - name: argocd-application-controller env: - name: ARGOCD_CONTROLLER_REPLICAS # match the number of the replicas above for proper sharding value: "2"
For Jsonnet implementation, which like it better, here’s how to patch an environment variable:
statefulset_argocd_application_controller+: { spec+: { replicas: app_controller_replicas, template+: { spec+: { containers: [ super.containers[0] { env: [ v for v in super.env if v.name != 'ARGOCD_CONTROLLER_REPLICAS' ] + [ { name: 'ARGOCD_CONTROLLER_REPLICAS', value: std.toString(app_controller_replicas), }, ], }, ], }, }, }, }, ...
🙂