Configuring Global Sync Timeout in ArgoCD v2.14+ on Akuity

How to set a global sync timeout for applications in Akuity’s ArgoCD environment

As of ArgoCD v2.14, a global sync timeout can be configured to prevent indefinitely stuck sync processes. This feature ensures long-running sync operations time out after a specified duration.

Why Use Global Sync Timeout?

The sync timeout prevents situations where resources fail to start properly and continue retrying indefinitely. The timeout can be configured within the ArgoCD Controller to ensure a defined limit for sync operations.

1. Applying Sync Timeout in Akuity’s Control Plane

Since the Akuity Platform does not use argocd-cmd-params-cm, you must configure the timeout using Kustomization and apply it via the Agent.

1.1 Using Kustomization to Set Sync Timeout

You can apply the following kustomization to an agent-managed cluster:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
patches:
  - patch: |
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: argocd-application-controller
        namespace: akuity
      spec:
        template:
          spec:
            containers:
              - name: argocd-application-controller
                env:
                  - name: "ARGOCD_APPLICATION_CONTROLLER_SYNC_TIMEOUT"
                    value: "300"  # Timeout in seconds (5 minutes)

2. Configuring Sync Timeout Using Terraform

If you manage your infrastructure with Terraform, you can set the sync timeout using the akp_cluster resource. Below is a sample manifest file for reference.

2.1 Example: Applying Sync Timeout to a Specific Cluster

data "akp_instance" "example" {
  name = "test"
}

resource "akp_cluster" "example" {
  instance_id = data.akp_instance.example.id
  name        = "test-cluster"
  namespace   = "test"
  spec = {
    cluster_customization_defaults = {
      kustomization = <<EOF
      apiVersion: kustomize.config.k8s.io/v1beta1
      kind: Kustomization
      patches:
        - patch: |-
            apiVersion: apps/v1
            kind: Deployment
            metadata:
              name: argocd-application-controller
              namespace: akuity
            spec:
              template:
                spec:
                  containers:
                    - name: argocd-application-controller
                      env:
                        - name: "ARGOCD_APPLICATION_CONTROLLER_SYNC_TIMEOUT"
                          value: "300"
      EOF
    }
  }
}

2.2 Applying Sync Timeout to All Agents

To apply the sync timeout globally across all agents, configure it in the akp_instance resource:
resource "akp_instance" "example" {
  name = "test"
  argocd = {
    spec = {
      cluster_customization_defaults = {
        kustomization = <<EOF
        apiVersion: kustomize.config.k8s.io/v1beta1
        kind: Kustomization
        patches:
          - patch: |
              apiVersion: apps/v1
              kind: Deployment
              metadata:
                name: argocd-application-controller
                namespace: akuity
              spec:
                template:
                  spec:
                    containers:
                      - name: argocd-application-controller
                        env:
                          - name: "ARGOCD_APPLICATION_CONTROLLER_SYNC_TIMEOUT"
                            value: "300"
        EOF
      }
    }
  }
}

Key Takeaways

Sync timeout prevents indefinitely stuck syncs
Must be configured using Kustomization in Akuity’s control plane
Can be applied to individual clusters or globally using Terraform
Consider increasing the timeout beyond 300 seconds (5 minutes) if necessary

For more details, refer to the ArgoCD v2.14 Release Notes.