Skip to main content
πŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy β€” plus the companion book on Leanpub & Amazon. Start Learning
Fix ArgoCD SyncError Application Out of Sync
DevOps

Fix ArgoCD SyncError Application Out of Sync

ArgoCD app stuck out of sync? Diagnose sync failures, hook errors, and resource health check issues. Step-by-step fix with kubectl commands and YAML examples.

LB
Luca Berton
Β· 1 min read

The Problem

Your ArgoCD application shows OutOfSync status even after syncing. The application never reaches Synced state.

Root Cause

OutOfSync means the live cluster state differs from the desired state in Git. Persistent OutOfSync usually means:

  1. Mutating webhooks or controllers modify resources after ArgoCD deploys them
  2. Default values added by Kubernetes that are not in your manifests
  3. Ignore differences not configured for fields that legitimately differ

Fix

Identify What Is Different

# Show the diff
argocd app diff my-app

# Detailed diff
argocd app diff my-app --local ./manifests

Ignore Expected Differences

# In your ArgoCD Application spec
spec:
  ignoreDifferences:
    - group: apps
      kind: Deployment
      jsonPointers:
        - /spec/replicas    # HPA manages replicas
    - group: ""
      kind: Service
      jqPathExpressions:
        - .metadata.annotations."cloud.google.com/neg-status"

Common Fields to Ignore

FieldReason
/spec/replicasHPA or KEDA manages scaling
/metadata/annotationsControllers add annotations
/metadata/labelsAdmission webhooks add labels
/statusKubernetes updates status

Force Sync

# Sync with prune
argocd app sync my-app --prune

# Sync specific resources only
argocd app sync my-app --resource apps:Deployment:my-deploy

Free 30-min AI & Cloud consultation

Book Now