argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
16.76k stars 5.08k forks source link

After clicking the SYNC button on the ArgoCD Dashboard, Git changes are not being synchronized. #18885

Open jungjuyoung2023 opened 1 week ago

jungjuyoung2023 commented 1 week ago

Checklist:

Describe the bug

After clicking SYNC in ArgoCD, Git changes are not synchronized. The live state does not match the target state, and the changes are not reflected immediately. As a result, PODs are created but then revert to the previous state.

To Reproduce

  1. Changes are made in Git.
  2. SYNC is clicked in the UI.
  3. A POD is created. -> Kubernetes Resource changes to the target state.
  4. The manifest in the UI does not reflect the changes from Git.
  5. The newly created POD immediately disappears.
  6. When the refresh interval occurs, synchronization completes and the POD is created again.

What settings should be adjusted to resolve this issue?

Expected behavior When SYNC is clicked, the current state should be compared to the target state, and changes should be applied accordingly.

Version

argocd version 2.5.0

Screenshots https://github.com/argoproj/argo-cd/assets/129713013/81fe1128-0f3f-48b6-84bf-7bfeb78059b4

ChristianCiach commented 1 week ago

Version v2.5.0 is almost two years old and has had multiple patch releases. Can you reproduce the issue with a recent version?

jungjuyoung2023 commented 6 days ago

@ChristianCiach We recently upgraded ArgoCD from version 2.0.0 to 2.5.0. After testing on a Kubernetes v1.24.0 After testing ArgoCD versions 2.11.4, 2.9.18, 2.7.7, and 2.7.9 on a Kubernetes v1.24.0 cluster, I found that the same issue occurs when clicking SYNC.

This issue seems to have originated in version 2.1.0-rc1, after version 2.0.5.

Upgrading to the latest version does not seem to resolve the issue. Is there a way to change this in the settings?

christianh814 commented 1 day ago

What you're describing is the expected behavior. You need to change the timeout in the Argo CD ConfigMap as described in the docs. This is set to every 3 minutes and can be changed by setting the following in the argocd-cm ConfigMap

data:
  timeout.reconciliation: 180s

Although I'd HIGHLY recommend clicking "Refresh" or "Hard Refresh" instead of "Sync" or set up. You can also automate this by either using the argocd CLI to do a sync/refresh when a change is made in git or use kubectl and annotate the Application resource with argocd.argoproj.io/refresh as described HERE