Skip to content

Commit

Permalink
docs: update sync-wave documentation
Browse files Browse the repository at this point in the history
Signed-off-by: chansuke <[email protected]>
  • Loading branch information
chansuke committed Dec 12, 2024
1 parent 87c853e commit e27d62e
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions docs/user-guide/sync-waves.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<iframe width="560" height="315" src="https://www.youtube.com/embed/zIHe3EVp528" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>

Argo CD executes a sync operation in a number of steps. At a high-level, there are three phases *pre-sync*, *sync* and *post-sync*.
Argo CD executes a sync operation in a number of steps. At a high-level, there are three phases *pre-sync*, *sync* and *post-sync*.

Within each phase you can have one or more waves, that allows you to ensure certain resources are healthy before subsequent resources are synced.
Within each phase you can have one or more waves, that allows you to ensure certain resources are healthy before subsequent resources are synced.

## How Do I Configure Phases?

Expand All @@ -32,17 +32,23 @@ metadata:
Hooks and resources are assigned to wave zero by default. The wave can be negative, so you can create a wave that runs before all other resources.
### Can Multiple Resources Share the Same Wave?
Yes, multiple resources can share the same sync-wave value. Resources with the same sync-wave are processed together.
Within a wave, resources are ordered by their kind (e.g. namespaces first) and then by their name.
## How Does It Work?
When Argo CD starts a sync, it orders the resources in the following precedence:
* The phase
* The wave they are in (lower values first for creation & updation and higher values first for deletion)
* By kind (e.g. [namespaces first and then other Kubernetes resources, followed by custom resources](https://github.com/argoproj/gitops-engine/blob/bc9ce5764fa306f58cf59199a94f6c968c775a2d/pkg/sync/sync_tasks.go#L27-L66))
* By name
* By name
It then determines the number of the next wave to apply. This is the first number where any resource is out-of-sync or unhealthy.
It applies resources in that wave.
It repeats this process until all phases and waves are in-sync and healthy.
Expand Down

0 comments on commit e27d62e

Please sign in to comment.