> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Reconciliation loop

> Explains Argo CD reconciliation loop, adjusting polling interval via timeout.reconciliation in argocd-cm, restarting repo-server, and using webhooks for instant sync.

A reconciliation loop is how often an [Argo CD](https://argo-cd.readthedocs.io/en/stable/) Application controller attempts to synchronize the declared desired state in Git with the live state in the Kubernetes cluster. In typical GitOps workflows with frequent commits, Argo CD polls the Git repository periodically (about every three minutes by default) to detect changes.

The polling behavior is implemented by the argocd-repo-server and is driven by the config key `timeout.reconciliation`. This key is exposed to the repo-server as the environment variable `ARGOCD_RECONCILIATION_TIMEOUT` via the `argocd-cm` ConfigMap.

To adjust how often Argo CD polls Git (for example, to poll every five minutes instead of the default three), update the `argocd-cm` ConfigMap with a new `timeout.reconciliation` value and restart the argocd-repo-server so it reads the change.

|                              Setting | Purpose                                    | Example                         |
| -----------------------------------: | ------------------------------------------ | ------------------------------- |
| `argocd-cm` `timeout.reconciliation` | Controls repo-server polling interval      | `"300s"` or `"5m"`              |
|                              Env var | Exposes the ConfigMap value to repo-server | `ARGOCD_RECONCILIATION_TIMEOUT` |
|                            Component | Where the change takes effect              | `argocd-repo-server` deployment |

Steps to change the reconciliation interval:

1. Inspect the repo-server pod environment to confirm the `ARGOCD_RECONCILIATION_TIMEOUT` reference.
2. Patch the `argocd-cm` ConfigMap with the desired timeout (include a time unit).
3. Restart the repo-server deployment to pick up the new value.
4. Verify the restarted pod shows the updated environment reference.

Example commands:

```bash theme={null}
# Inspect the repo-server pod environment to see the ARGOCD_RECONCILIATION_TIMEOUT reference
kubectl -n argocd describe pod -l app.kubernetes.io/name=argocd-repo-server | grep -i "ARGOCD_RECONCILIATION_TIMEOUT:" -B1

# Patch the ConfigMap to set the reconciliation timeout to 300 seconds (5 minutes)
kubectl -n argocd patch configmap argocd-cm --patch='{"data":{"timeout.reconciliation":"300s"}}'

# Example output:
# Restart the repo-server deployment to pick up the new configuration
kubectl -n argocd rollout restart deploy argocd-repo-server

# Example output:
# After the rollout completes, list the repo-server pods and verify the env entry references the configmap key
kubectl -n argocd get pods -l app.kubernetes.io/name=argocd-repo-server
kubectl -n argocd describe pod <argocd-repo-server-pod-name> | grep -i "ARGOCD_RECONCILIATION_TIMEOUT:" -B1
```

<Callout icon="lightbulb" color="#1CB2FE">
  When setting `timeout.reconciliation`, always include a time unit (for example `300s` or `5m`). Very short polling intervals increase load on your Git provider and Argo CD components — pick an interval that balances responsiveness and resource usage for your environment.
</Callout>

Polling introduces a small delay between a Git push and Argo CD reconciling that change (three minutes by default). If you require near-instant synchronization, configure push-based notifications (webhooks) from your Git provider so Argo CD is notified immediately when commits are pushed.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/U0-OU4Duc207J7ou/images/Prep-Course-Certified-Argo-Project-Associate-CAPA/ArgoCD/Reconciliation-loop/argocd-webhook-reconciliation-diagram.jpg?fit=max&auto=format&n=U0-OU4Duc207J7ou&q=85&s=a63778f5fd8d065b48b7cb62cb1e7f91" alt="A diagram titled &#x22;Reconciliation Loop – WebHook&#x22; showing a developer pushing a commit to GitHub which triggers Argo CD components. It depicts argocd-server and argocd-repo-server pods running inside a Kubernetes cluster with Argo CD and Kubernetes icons." width="1920" height="1080" data-path="images/Prep-Course-Certified-Argo-Project-Associate-CAPA/ArgoCD/Reconciliation-loop/argocd-webhook-reconciliation-diagram.jpg" />
</Frame>

To use webhooks, create a webhook in your Git provider (for example, [GitHub](https://github.com) or [GitLab](https://gitlab.com)) that targets the Argo CD server webhook endpoint:

/api/webhook

A push event to the repository will notify Argo CD immediately, prompting it to pull the committed changes and reconcile without waiting for the next poll. Ensure the Argo CD API server is reachable from your Git provider (directly or via a secure proxy), and secure the webhook (TLS, secret/signature verification, and network restrictions).

<Callout icon="warning" color="#FF6B6B">
  Make sure the Argo CD API server endpoint used for webhooks is accessible from your Git provider. Protect webhook traffic using TLS, verify payload signatures or secrets, and restrict network access to reduce risk.
</Callout>

Links and references

* [Argo CD documentation — Configuration](https://argo-cd.readthedocs.io/en/stable/operator-manual/config-management/)
* [Kubernetes kubectl reference](https://kubernetes.io/docs/reference/kubectl/)
* Git provider docs: [GitHub Webhooks](https://docs.github.com/en/developers/webhooks-and-events/creating-webhooks), [GitLab Webhooks](https://docs.gitlab.com/ee/user/project/integrations/webhooks/)

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/certified-argo-project-associate-capa/module/9facbd04-7a3f-4200-9d6e-53936e93d875/lesson/197dd1cb-9df3-4352-ada6-e62e5ca364f8" />
</CardGroup>
