github.com/argoproj/argo-cd@v1.8.7/docs/user-guide/sync-waves.md (about)

     1  # Sync Phases and Waves
     2  
     3  >v1.1
     4  
     5  <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>
     6  
     7  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*.  
     8  
     9  Within each phase you can have one or more waves, than allows you to ensure certain resources are healthy before subsequent resources are synced.   
    10  
    11  ## How Do I Configure Phases?
    12  
    13  Pre-sync and post-sync can only contain hooks. Apply the hook annotation:
    14  
    15  ```yaml
    16  metadata:
    17    annotations:
    18      argocd.argoproj.io/hook: PreSync
    19  ```
    20  
    21  [Read more about hooks](resource_hooks.md).
    22  
    23  ## How Do I Configure Waves?
    24  
    25  Specify the wave using the following annotation:
    26  
    27  ```yaml
    28  metadata:
    29    annotations:
    30      argocd.argoproj.io/sync-wave: "5"
    31  ```
    32  
    33  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.
    34  
    35  ## How Does It Work?
    36  
    37  When Argo CD starts a sync, it orders the resources in the following precedence:
    38  
    39  * The phase
    40  * The wave they are in (lower values first)
    41  * By kind (e.g. namespaces first)
    42  * By name 
    43  
    44  It then determines which the number of the next wave to apply. This is the first number where any resource is out-of-sync or unhealthy.
    45   
    46  It applies resources in that wave. 
    47  
    48  It repeats this process until all phases and waves are in in-sync and healthy.
    49  
    50  Because an application can have resources that are unhealthy in the first wave, it may be that the app can never get to healthy.