Application Spec Structure
You'll learn: How the ArgoCD Application spec is organized and what each major field controls in your GitOps deployments.
What Is the Application Spec?
In ArgoCD, every Application resource follows a specific structure defined in its spec section. Think of the spec as a detailed instruction manual that tells ArgoCD where to find your desired state (source), where to deploy it (destination), and how to keep everything synchronized (syncPolicy). Understanding this structure is essential for creating reliable, maintainable GitOps workflows.
Core Spec Fields
Source
The source field defines your Git repository details:
repoURL: The Git repository URLpath: Directory containing manifeststargetRevision: Branch, tag, or commit SHA
This tells ArgoCD where to find your Kubernetes manifests.
Destination
The destination field specifies the target cluster and namespace:
server: Kubernetes API server URL (oftenhttps://kubernetes.default.svcfor in-cluster)namespace: Target namespace for deployment
SyncPolicy
The syncPolicy field controls automation behavior:
automated: Enables auto-sync, self-heal, and prune optionssyncOptions: Additional sync behaviors (like creating namespace if missing)retry: Defines retry logic for failed syncs
Project
References an ArgoCD Project for access control and resource restrictions—connecting to your multi-tenancy setup.
Additional Fields
info: Metadata links for documentationignoreDifferences: Rules to ignore specific field differences during syncrevisionHistoryLimit: Number of previous sync states to retain
Key Takeaway: The Application spec's structure—source, destination, syncPolicy, and project—forms the complete contract between your Git repository and your Kubernetes cluster, enabling ArgoCD to maintain continuous synchronization.