github.com/argoproj/argo-cd/v2@v2.10.9/docs/operator-manual/applicationset/Progressive-Syncs.md (about)

     1  # Progressive Syncs
     2  
     3  !!! warning "Alpha Feature"
     4      This is an experimental, alpha-quality feature that allows you to control the order in which the ApplicationSet controller will create or update the Applications owned by an ApplicationSet resource. It may be removed in future releases or modified in backwards-incompatible ways.
     5  
     6  ## Use Cases
     7  The Progressive Syncs feature set is intended to be light and flexible. The feature only interacts with the health of managed Applications. It is not intended to support direct integrations with other Rollout controllers (such as the native ReplicaSet controller or Argo Rollouts).
     8  
     9  * Progressive Syncs watch for the managed Application resources to become "Healthy" before proceeding to the next stage.
    10  * Deployments, DaemonSets, StatefulSets, and [Argo Rollouts](https://argoproj.github.io/argo-rollouts/) are all supported, because the Application enters a "Progressing" state while pods are being rolled out. In fact, any resource with a health check that can report a "Progressing" status is supported.
    11  * [Argo CD Resource Hooks](../../user-guide/resource_hooks.md) are supported. We recommend this approach for users that need advanced functionality when an Argo Rollout cannot be used, such as smoke testing after a DaemonSet change.
    12  
    13  ## Enabling Progressive Syncs
    14  As an experimental feature, progressive syncs must be explicitly enabled, in one of these ways.
    15  
    16  1. Pass `--enable-progressive-syncs` to the ApplicationSet controller args.
    17  1. Set `ARGOCD_APPLICATIONSET_CONTROLLER_ENABLE_PROGRESSIVE_SYNCS=true` in the ApplicationSet controller environment variables.
    18  1. Set `applicationsetcontroller.enable.progressive.syncs: true` in the Argo CD `argocd-cmd-params-cm` ConfigMap.
    19  
    20  ## Strategies
    21  
    22  * AllAtOnce (default)
    23  * RollingSync
    24  
    25  ### AllAtOnce
    26  This default Application update behavior is unchanged from the original ApplicationSet implementation.
    27  
    28  All Applications managed by the ApplicationSet resource are updated simultaneously when the ApplicationSet is updated.
    29  
    30  ### RollingSync
    31  This update strategy allows you to group Applications by labels present on the generated Application resources.
    32  When the ApplicationSet changes, the changes will be applied to each group of Application resources sequentially.
    33  
    34  * Application groups are selected using their labels and `matchExpressions`.
    35  * All `matchExpressions` must be true for an Application to be selected (multiple expressions match with AND behavior).
    36  * The `In` and `NotIn` operators must match at least one value to be considered true (OR behavior).
    37  * The `NotIn` operator has priority in the event that both a `NotIn` and `In` operator produce a match.
    38  * All Applications in each group must become Healthy before the ApplicationSet controller will proceed to update the next group of Applications.
    39  * The number of simultaneous Application updates in a group will not exceed its `maxUpdate` parameter (default is 100%, unbounded).
    40  * RollingSync will capture external changes outside the ApplicationSet resource, since it relies on watching the OutOfSync status of the managed Applications.
    41  * RollingSync will force all generated Applications to have autosync disabled. Warnings are printed in the applicationset-controller logs for any Application specs with an automated syncPolicy enabled.
    42  * Sync operations are triggered the same way as if they were triggered by the UI or CLI (by directly setting the `operation` status field on the Application resource). This means that a RollingSync will respect sync windows just as if a user had clicked the "Sync" button in the Argo UI.
    43  * When a sync is triggered, the sync is performed with the same syncPolicy configured for the Application. For example, this preserves the Application's retry settings.
    44  * If an Application is considered "Pending" for `applicationsetcontroller.default.application.progressing.timeout` seconds, the Application is automatically moved to Healthy status (default 300).
    45  
    46  #### Example
    47  The following example illustrates how to stage a progressive sync over Applications with explicitly configured environment labels.
    48  
    49  Once a change is pushed, the following will happen in order.
    50  
    51  * All `env-dev` Applications will be updated simultaneously.
    52  * The rollout will wait for all `env-qa` Applications to be manually synced via the `argocd` CLI or by clicking the Sync button in the UI.
    53  * 10% of all `env-prod` Applications will be updated at a time until all `env-prod` Applications have been updated.
    54  
    55  ```yaml
    56  apiVersion: argoproj.io/v1alpha1
    57  kind: ApplicationSet
    58  metadata:
    59    name: guestbook
    60  spec:
    61    generators:
    62    - list:
    63        elements:
    64        - cluster: engineering-dev
    65          url: https://1.2.3.4
    66          env: env-dev
    67        - cluster: engineering-qa
    68          url: https://2.4.6.8
    69          env: env-qa
    70        - cluster: engineering-prod
    71          url: https://9.8.7.6/
    72          env: env-prod
    73    strategy:
    74      type: RollingSync
    75      rollingSync:
    76        steps:
    77          - matchExpressions:
    78              - key: envLabel
    79                operator: In
    80                values:
    81                  - env-dev
    82            #maxUpdate: 100%  # if undefined, all applications matched are updated together (default is 100%)
    83          - matchExpressions:
    84              - key: envLabel
    85                operator: In
    86                values:
    87                  - env-qa
    88            maxUpdate: 0      # if 0, no matched applications will be updated
    89          - matchExpressions:
    90              - key: envLabel
    91                operator: In
    92                values:
    93                  - env-prod
    94            maxUpdate: 10%    # maxUpdate supports both integer and percentage string values (rounds down, but floored at 1 Application for >0%)
    95    goTemplate: true
    96    goTemplateOptions: ["missingkey=error"]
    97    template:
    98      metadata:
    99        name: '{{.cluster}}-guestbook'
   100        labels:
   101          envLabel: '{{.env}}'
   102      spec:
   103        project: my-project
   104        source:
   105          repoURL: https://github.com/infra-team/cluster-deployments.git
   106          targetRevision: HEAD
   107          path: guestbook/{{.cluster}}
   108        destination:
   109          server: '{{.url}}'
   110          namespace: guestbook
   111  ```