List vs Cluster Generators: Choosing the Right ApplicationSet for Sync Latency
0 reputation · 28 Jun 2024, 03:21 UTC
0 reputation · 28 Jun 2024, 03:21 UTC
Argo CD’s ApplicationSet supports List and Cluster generators, each expanding into a set of Application manifests that the controller reconciles during a sync loop. The choice directly influences controller latency and API object count.
Expose the argocd_app_controller_sync_duration_seconds histogram via the metrics endpoint, and compare the median and 95th‑percentile values for List vs Cluster generators under identical workloads. Additionally, verify whether the resources‑finalizer.argocd.argoproj.io finalizer is cleared after a non‑cascade delete.
1. Under a 100‑item workload, does the Cluster generator consistently lower the median sync duration compared to the List generator?
2. Does the finalizer persist after argocd app delete --cascade=false, or is it removed automatically in the current Argo CD release?
3. What is the impact on controller memory consumption when switching from List to Cluster generators?
31775 reputation · 28 Jun 2024, 08:06 UTC
For a 100-item workload across 10 clusters, the Cluster generator will usually produce fewer Application CRs (one per cluster, ~10) than the List generator (one per element, ~100), and fewer CRs generally means less reconciliation work per sync loop. Whether that translates into a consistently lower median sync duration depends on your environment — the generator affects object count, but sync time is dominated by API server latency, repo-server fetches, and cluster state. Measure both under identical conditions before concluding anything.
Confirmed, well-established behavior:
elements. The Cluster generator emits one Application per registered cluster secret (labelled argocd.argoproj.io/secret-type=cluster), optionally filtered by a selector.Likely, but environment-dependent:
histogram_quantile(0.95,
sum(rate(argocd_app_controller_sync_duration_seconds_bucket[10m])) by (le)
)kubectl top pod -n argocd or container memory metrics) during each run.With argocd app delete --cascade=false, the resources-finalizer.argocd.argoproj.io finalizer is expected to be removed by the controller after it processes the deletion without cascading to child resources. If it hangs, the usual causes are the controller being down, the Application's destination cluster being unreachable, or another finalizer/admission webhook blocking removal — not the generator type. Verify with:
argocd app delete myapp --cascade=false
kubectl get app myapp -n argocd -o jsonpath='{.metadata.finalizers}'
kubectl get events -n argocd -wIf the finalizer persists for more than a couple of minutes with a healthy controller, capture kubectl describe app myapp -n argocd and controller logs before forcing removal.
If your 100 list entries are really "the same app deployed to 10 clusters with 10 variants each," prefer the Cluster generator combined with template parameters or a matrix generator — fewer CRs, less controller load, simpler blast radius. Keep the List generator when each element is a genuinely distinct application. One missing detail that would change this: are your 100 items homogeneous (same repo/chart, different values) or distinct apps? If distinct, the Cluster generator alone won't model them.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.