Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

🏠 Back to Blog

ArgoCD Reconciliation Loop

  • ArgoCD operates a controller that runs in a reconciliation loop, constantly comparing live application state vs. stored application state, and reconciling the two.

  • Drift detection happens out-of-the-box with ArgoCD. However, self-heal needs to be enabled for the drift to be fixed.

  • On average, Argo takes 3 minutes to reconcile an app. The timeout is controlled via the ARGOCD_RECONCILIATION_TIMEOUT env var:

λ notes (main) $ k get deploy argocd-repo-server -oyaml |grep -i reconcil -A10
        - name: ARGOCD_RECONCILIATION_TIMEOUT
          valueFrom:
            configMapKeyRef:
              key: timeout.reconciliation
              name: argocd-cm
              optional: true

λ notes (main) $ k get cm argocd-cm -oyaml |grep -i reconciliation
  timeout.hard.reconciliation: 0s
  timeout.reconciliation: 180s
  • You can also create a webhook in Github pointing to your ArgoCD instance. This way, when new code is pushed, Github will notify ArgoCD and ArgoCD will then reconcile the app.

Sync Policy

  • Auto/Manual -
  • Auto-prune resources - Describes what happens when files are deleted from the git repo
  • Self-heal cluster - defines what actions argo will take when you manually update resources (with kubectl for example)
  • You can also ignore certain properties within a spec. For example, to ignore changes to the replicaCount and configMap (config.yaml), add this to the Application spec:
      ignoreDifferences:
    # for the specified json pointers
    - group: apps
      kind: Deployment
      jsonPointers:
      - /spec/replicas
    - kind: ConfigMap
      jqPathExpressions:
      # Example: Ignore changes to a specific key inside a ConfigMap
      - '.data["config.yaml"]'
    # for the specified managedFields managers
    - group: "*"
      kind: "*"
      managedFieldsManagers:
      - kube-controller-manager
      # Name and namespace are optional. If specified, they must match exactly, these are not glob patterns.
      name: my-deployment
      namespace: my-namespace
    
    
    • note that you must also enable respectIgnoreDifferences:
          - RespectIgnoreDifferences=true # When syncing changes, respect fields ignored by the ignoreDifferences configuration