Argo CD Application health status lag during deployment failures
0 reputation · 23 Jun 2020, 01:49 UTC
0 reputation · 23 Jun 2020, 01:49 UTC
Argo CD monitors the health of Kubernetes resources by comparing the live state against the desired state. When a deployment fails—such as a pod entering a CrashLoopBackOff or ImagePullBackOff state—the Application controller updates the health status to Degraded.
There is a known operational gap regarding the latency between the actual Kubernetes event and the status reflection in the Argo CD UI. Because the Application controller relies on a polling interval to synchronize state, the reported health may not align in real-time with the resource logs.
Given the default polling behavior in recent versions, what are the specific configuration parameters available to reduce this synchronization lag? Additionally, does adjusting these intervals impact the performance of the Application controller when managing a high volume of resources?
35275 reputation · 23 Jun 2020, 02:10 UTC
Argo CD’s Application controller polls the Kubernetes API to reconcile desired and live state. The latency between a failure event (e.g., CrashLoopBackOff) and the UI showing Degraded is controlled by a handful of timeout settings in the argocd-cm ConfigMap.
timeout.reconciliation – The maximum time a resource is considered for a reconciliation loop. Default: 3m (Argo CD 2.7+). Setting it to 30s or 15s will make the controller re‑evaluate a resource more frequently.timeout.resource – The timeout applied to individual resource syncs. Default: 3m. Lowering this reduces how long a resource can stay in a pending state before the controller retries.resource.customizations.health – While not a polling interval, you can provide a custom health.lua script that returns Degraded immediately when a pod status matches a failure pattern, bypassing the default health‑check delay.resource.customizations.refresh – Setting refresh: sync forces a refresh on every sync operation instead of the default OnChange, which can tighten the loop when deployments fail.# Inspect current settings
kubectl -n argocd get cm argocd-cm -o yaml | grep -E 'timeout.reconciliation|timeout.resource'
# Patch the ConfigMap (example: set reconciliation to 30s)
kubectl -n argocd patch cm argocd-cm --type merge -p '{"data":{"timeout.reconciliation":"30s"}}'
# (Optional) Add a custom health script
kubectl -n argocd patch cm argocd-cm --type merge -p '{"data":{"resource.customizations.health":"{\"Deployment\":{\"health.lua\":\"...\"}}"}}'
Every reduction in these intervals increases the number of API calls the Application controller makes. In clusters with thousands of resources:
timeout.reconciliation is set below 30 s.Best practice is to:
argocd-application-controller metrics (CPU, memory, API request count) after each change.health.lua script for the most critical workloads so that the UI reflects failures almost instantly without globally lowering polling intervals.How many resources does your application manage, and what is the average API server request limit on your cluster? Knowing this will help decide whether a 15 s timeout is safe or if a 30 s setting is preferable.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.