Advanced Argo CD: Sync Waves, ApplicationSets, HA (2027)
30 advanced Argo CD questions: sync waves and hooks, sync options, ignoreDifferences, resource tracking, ApplicationSet generators, sharding.
Advanced Argo CD questions go past "what is GitOps" and test how you control sync order, template many Applications, tune diffing, track resources and scale the controller. This guide has 30 answered questions on ApplicationSet generators, sync waves and hooks, sync options, ignoreDifferences, resource tracking and high availability, checked against the Argo CD docs (release v3.6.1 at the time of writing).
New to Argo CD? Read 70+ Argo CD interview questions first. This page covers internals and scale. For production incidents see scenario-based Argo CD questions, for the CLI see real-time Argo CD questions, and for RBAC and SSO see Argo CD security FAQs.
Key takeaways
- Sync order is decided by phase, then wave, then resource kind, then name. Waves default to 0 and run lowest first, with a 2 second pause between waves.
- ApplicationSet generators (List, Cluster, Git, Matrix, Merge, SCM Provider, Pull Request, Cluster Decision Resource, Plugin and OCI) create many Applications from one template.
- Diff noise is handled with ignoreDifferences by jsonPointers, jqPathExpressions or managedFieldsManagers. Add RespectIgnoreDifferences=true if the ignore rule must also apply during sync.
- Resource tracking defaults to the annotation method, which uses the argocd.argoproj.io/tracking-id annotation.
- Scale with more application controller replicas (sharding), a repo server parallelism limit and tuned processors, not with a bigger single pod alone.
Level 1: Sync control
1. What decides the order in which Argo CD applies resources?
Phase first, then sync wave (lower first), then resource kind (namespaces, other Kubernetes resources, then custom resources), then name. This is why a Namespace is created before a Deployment without you doing anything, and why a wave is only needed when two resources of the same kind must be ordered.
2. How do sync waves work?
You set the annotation argocd.argoproj.io/sync-wave to an integer. Lower numbers deploy first, negative numbers are allowed, and resources without the annotation are in wave 0. Argo CD waits for each wave to be healthy and pauses 2 seconds between waves; ARGOCD_SYNC_WAVE_DELAY changes that pause.
metadata:
annotations:
argocd.argoproj.io/sync-wave: "-1"
3. What are the resource hook types?
PreSync, Sync, PostSync, SyncFail, Skip, PreDelete and PostDelete. PreSync runs before manifests apply, PostSync after the sync is healthy, and SyncFail when the sync fails. Skip means the resource is not applied. Hooks do not run during a selective sync.
4. How do you set a hook and clean it up?
Add argocd.argoproj.io/hook: PreSync to a Job or Pod and set argocd.argoproj.io/hook-delete-policy to HookSucceeded, HookFailed or BeforeHookCreation. BeforeHookCreation is used when you set no policy, and it removes the previous hook resource before a new one is created.
5. What is the difference between PreDelete and PostDelete hooks?
PreDelete runs only when the whole Application is deleted, before its resources are removed. PostDelete runs after all of the Application's resources are gone. Use PreDelete for backups or deregistration and PostDelete for external cleanup.
6. How does pruning interact with waves?
Wave order is reversed for pruning, so higher waves are pruned first. If pruning fails in one wave, lower waves are not processed. PruneLast=true instead runs pruning as a final implicit wave after everything else is deployed and healthy.
7. Which sync options matter most in production?
| Option | Effect |
|---|---|
| CreateNamespace=true | Creates the destination namespace if missing |
| ServerSideApply=true | Applies with kubectl apply --server-side --force-conflicts |
| ApplyOutOfSyncOnly=true | Applies only out-of-sync resources, useful for large apps |
| Prune=false / Prune=confirm | Never prune, or require manual confirmation |
| Replace=true | Uses kubectl replace or create, and can be destructive |
| FailOnSharedResource=true | Fails if another Application already applied the resource |
| RespectIgnoreDifferences=true | Applies ignoreDifferences during sync, not just diff |
8. When would you use ServerSideApply?
For very large manifests such as big CRDs that exceed the client-side annotation size limit, and when several controllers co-own fields. Set it on the Application or per resource. Replace=true takes precedence over it, and Force=true is ignored when only server-side apply is on.
9. What does Prune=confirm do?
The sync stays in the Syncing state until someone approves the prune in the UI, the CLI or by adding the argocd.argoproj.io/deletion-approved annotation. It is a safety catch for production resources.
Level 2: Diffing, tracking and drift
10. How do you stop a field from showing as out of sync?
Use spec.ignoreDifferences on the Application with group, kind, and one of jsonPointers, jqPathExpressions or managedFieldsManagers. A common case is /spec/replicas on a Deployment managed by an autoscaler.
spec:
ignoreDifferences:
- group: apps
kind: Deployment
jsonPointers:
- /spec/replicas
11. Why does an ignored field still get overwritten on sync?
By default ignoreDifferences affects only the diff. Add RespectIgnoreDifferences=true to syncOptions so the sync leaves those fields alone. It only helps when the resource already exists in the cluster.
12. How do you set ignore rules for the whole instance?
In the argocd-cm ConfigMap, using keys like resource.customizations.ignoreDifferences.apps_Deployment, where group and kind are joined by an underscore. The key all applies to every resource. This suits admission webhook caBundle fields that every Application sees.
13. What setting handles aggregated ClusterRoles?
Set resource.compareoptions.ignoreAggregatedRoles: true in argocd-cm, so changes to rules that Kubernetes fills in on aggregated roles are not treated as drift.
14. How does Argo CD know which live resources belong to an Application?
Through resource tracking. The methods are label, annotation and annotation+label, set with application.resourceTrackingMethod in argocd-cm. The default is annotation, using argocd.argoproj.io/tracking-id. Annotation tracking avoids the 63 character label limit that makes label values awkward.
15. Why set an installationID?
When more than one Argo CD instance manages the same cluster, an installation ID stops them from claiming each other's resources. Managed resources get the argocd.argoproj.io/installation-id annotation.
16. A resource is claimed by two Applications. How do you catch it?
Set FailOnSharedResource=true on the Applications. The sync then fails if another Application already applied that resource, which turns a silent fight into a visible error.
Level 3: ApplicationSet and multi-cluster
17. What does an ApplicationSet do?
It generates Application resources from a template plus generator output. Add a cluster, a directory or a pull request, and the matching Application appears or disappears without hand-written YAML.
18. Name the generators and what each is for.
| Generator | Use |
|---|---|
| List | Fixed key/value lists, such as environments |
| Cluster | Clusters registered in Argo CD |
| Git | Directories or files in a Git repository |
| Matrix and Merge | Combine or override parameters from other generators |
| SCM Provider | Repositories discovered through a provider API |
| Pull Request | Open pull requests for preview environments |
| Cluster Decision Resource | A custom resource decides which clusters |
| Plugin | Parameters from an HTTP RPC call |
| OCI | Files or directories in an OCI artifact |
19. Matrix or Merge: which one when?
Matrix produces every combination of two generators, such as every cluster crossed with every app directory. Merge combines parameters from two or more generators and lets later ones override a base, such as per-cluster overrides on top of defaults.
20. How do you build preview environments per pull request?
Use the Pull Request generator against your SCM provider, template the Application name and namespace from the pull request number, and let the ApplicationSet delete the Application when the pull request closes.
21. What can go wrong with an ApplicationSet that generates too much?
A bad generator or template can create or delete many Applications at once. Review the prune and deletion behavior in your ApplicationSet policy, test templates in a non-production Argo CD first, and keep the generated Applications' own sync policy conservative.
Level 4: Scale and high availability
22. What are the HA components and their constraints?
The repo server, application controller, API server, Dex and Redis. The API server is stateless, so run three or more replicas and set ARGOCD_API_SERVER_REPLICAS to match. Redis HA is built for three servers or sentinels, and the HA install needs at least three nodes because of pod anti-affinity.
23. How do you shard the application controller?
Raise the replica count of the argocd-application-controller StatefulSet and set ARGOCD_CONTROLLER_REPLICAS to the same number. Pick an algorithm with controller.sharding.algorithm in argocd-cmd-params-cm: legacy (UID based), round-robin or consistent-hashing. Shards are assigned per cluster, and you can pin one with the shard property in the cluster Secret.
24. What are the default processor counts?
Status processors default to 20 and operation processors to 10, and hydration processors to 5 when the source hydrator is on. Raise status processors when reconciliation lags across many Applications, and operation processors when syncs queue.
25. How do you protect the repo server in a monorepo?
Set --parallelismlimit to cap concurrent manifest generations so the pod is not killed for memory. Remember that generation that may change local clone files runs one at a time per instance, so many Applications on one repo queue behind each other. Webhooks, not polling alone, reduce wasted refreshes.
26. What does ARGOCD_RECONCILIATION_JITTER do?
It adds jitter to the refresh timeout, with a default of 60, so that thousands of Applications do not all refresh at the same moment.
27. What is the default exec timeout for manifest tools?
90 seconds, controlled by ARGOCD_EXEC_TIMEOUT. Slow Helm dependency pulls or heavy Kustomize builds that exceed it fail the refresh.
Scenarios
28. A database migration Job must finish before the new Deployment starts. How?
Make the Job a PreSync hook with hook-delete-policy BeforeHookCreation. The sync only continues when the Job succeeds. If the migration fails, add a SyncFail hook to notify the team.
29. Fleet of 80 clusters, same add-ons everywhere, some clusters need overrides. Design?
One ApplicationSet using a Merge generator: a base Cluster generator for defaults and a Git generator reading per-cluster override files. Template the destination from cluster data and add ApplyOutOfSyncOnly to keep syncs small.
30. After enabling a horizontal autoscaler the app flips between Synced and OutOfSync. Fix?
The autoscaler changes replicas and Git disagrees. Add ignoreDifferences on /spec/replicas, or remove replicas from the manifest, and add RespectIgnoreDifferences=true if sync should not reset it.
Where to go next
Practise these on a local cluster, then compare with the GitOps principles in GitOps and Argo CD interview questions and the experience-level track in Argo CD questions for experienced engineers. For the wider picture read top GitOps tools for Kubernetes. Hands-on labs are part of our DevOps course.
Frequently asked questions
What is the default sync wave?
Zero. Lower waves run first and negative values are allowed.
Is the annotation or label tracking method the default?
Annotation. Change it with application.resourceTrackingMethod in argocd-cm.
How many generators does an ApplicationSet support?
The docs list ten: List, Cluster, Git, Matrix, Merge, SCM Provider, Pull Request, Cluster Decision Resource, Plugin and OCI.
Do hooks run on a selective sync?
No. Hooks do not run during a selective sync.
How do I run several application controller replicas?
Scale the StatefulSet and set ARGOCD_CONTROLLER_REPLICAS to the same number, then choose a sharding algorithm.
What is the default number of status processors?
20, with 10 operation processors.
Should I use Replace=true?
Only for a specific resource that cannot be applied normally. The docs warn that replace can be destructive and cause outages.
Where do I find the latest Argo CD version?
On the Argo CD GitHub releases page. This guide was checked against v3.6.1.
Official references
What's Your Reaction?
Like
0
Dislike
0
Love
0
Funny
0
Angry
0
Sad
0
Wow
0