Controlling AutoSync Behavior in Akuity Argo CD

Automatically syncing applications and then disabling AutoSync

Akuity Argo CD does not have a built-in toggle to automatically disable AutoSync after the initial deployment, but you can achieve this workflow with some manual intervention or automation.

Desired Workflow:

  1. A new cluster joins the Akuity Argo CD instance.

  2. The ApplicationSet detects the new cluster and generates applications.

  3. The apps are automatically synced to the cluster (using AutoSync).

  4. AutoSync is disabled after deployment to allow manual modifications.

Possible Solutions

1. Manual Update to Remove AutoSync

  • After initial sync, manually update the Application manifest to remove the automated field under syncPolicy or disable the auto sync directly from the UI.

    • Example:

      syncPolicy:
         automated: {} # Remove or modify this field after initial sync

2. Using Labels/Annotations in ApplicationSet

  • Add a custom label/annotation (e.g., autosync: enabled) to toggle AutoSync.

  • Once apps are synced, update the label to autosync: disabled.

  • This can be automated via a CI/CD job or script that calls the Argo CD API to update the ApplicationSet.

3. Using ApplicationSet’s applicationsSync Policy

  • The applicationsSync setting in the ApplicationSet can prevent unwanted modifications after the initial deployment.

    • Example:
      syncPolicy:
        applicationsSync: create-only # Prevents ApplicationSet controller from modifying or deleting Application
  • More details: Argo CD Documentation

Key Takeaway

While Akuity Argo CD does not natively support turning AutoSync off automatically after initial deployment, you can achieve this by manually updating the sync policy or using labels.