ArgoCD can check automatically if the application is out of sync either by a reconciliation timeout (default time is 3 minutes) or a webhook via the git repository
To edit reconciliation time out:
# check current time
kubectl -n argocd describe pod argo-repo-server | grep -i "ARGOCD_RECONCILIATION_TIMEOUT:"
# change to 5 mins
kubectl -n argocd patch configmap argocd-cm --patch='{"data":{"timeout.reconciliation":"300s"}}'
# or
kubectl -n argocd edit configmaps argocd-cm
# restart after reconfiguring
kubectl -n argocd rollout restart deployment argocd-repo-server
In case of testing purposes when using a webhook and it failed because it can’t validate the certificate (self-assigned), edit the argocd-server to make it perform on http instead of https using kubectl -n argocd edit deployment argocd-server
and look for the command in the containers and add additional argument --insecure
containers:
- commands:
- argocd-server
- --insecure # new argument
To enable all three sync options:
or run the following command
argocd app set <app_name> --sync-policy=auto --self-heal --auto-prune