How to Deploy Applications with Argo CD: GitOps Delivery Step-by-Step
Argo CD deploys applications by continuously monitoring a Git repository and automatically syncing the desired state to a target Kubernetes cluster using declarative Application CRDs.
Argo CD is a declarative, GitOps continuous delivery tool for Kubernetes that lives in the argoproj/argo-cd repository. Learning how to deploy applications with Argo CD enables you to automate the delivery of Helm charts, Kustomize overlays, or plain YAML manifests directly from version control to your clusters.
Argo CD Architecture Components
Argo CD consists of four core components that work together to reconcile your Git repository with the live cluster state:
- API Server: Exposes the REST/gRPC API used by the CLI and UI, handling application management requests. Source:
server/application/application.go. - Repo Server: Pulls manifests from Git, Helm, OCI, or other sources, renders templates (Helm/Jsonnet/Kustomize), and caches the results. Source:
server/repository/repository.go. - Application Controller: Continuously watches Application CRDs, compares live cluster state with rendered manifests, and executes sync operations via
kubectl apply-style reconciliation. Source:server/application/application.go. - UI (Web Console): Provides the visual interface for creating applications and triggering manual syncs. Source:
ui/src/app/applications/components/application-sync-panel/application-sync-panel.tsx.
Prerequisites: Cluster Registration
Before deploying applications, you must register the target cluster. If deploying to the same cluster where Argo CD runs, this step is optional as the in-cluster configuration is available by default.
Method 1: Deploy via CLI
The Argo CD CLI provides the fastest way to deploy applications using the argocd app create and argocd app sync commands documented in docs/user-guide/commands/argocd_app_create.md.
Creating a Directory-Based Application
To deploy plain Kubernetes manifests from a Git repository:
# Create the application
argocd app create guestbook \
--repo https://github.com/argoproj/argo-cd-example-apps.git \
--path guestbook \
--dest-server https://kubernetes.default.svc \
--dest-namespace default \
--directory-recurse
# Check initial status (typically OutOfSync)
argocd app get guestbook
# Deploy the application
argocd app sync guestbook
The --directory-recurse flag instructs the Repo Server to recursively scan the specified path for manifest files.
Creating a Helm-Based Application
To deploy a Helm chart with custom values:
argocd app create helm-guestbook \
--repo https://github.com/argoproj/argo-cd-example-apps.git \
--path helm-guestbook \
--dest-server https://kubernetes.default.svc \
--dest-namespace default \
--helm-set replicaCount=2
The --helm-set flag passes configuration values to Helm during the template rendering phase executed by the Repo Server.
Method 2: Deploy via the UI
For interactive deployments, use the web console component located in ui/src/app/applications/components/application-sync-panel/application-sync-panel.tsx:
- Navigate to the Argo CD UI (
http://<argocd-server>/) and authenticate. - Click + New App in the top toolbar.
- Configure the Application:
- Application Name:
guestbook - Project:
default - Repository URL:
https://github.com/argoproj/argo-cd-example-apps.git - Revision:
HEAD - Path:
guestbook - Destination: Cluster
https://kubernetes.default.svc, Namespacedefault
- Application Name:
- Click Create to store the Application CRD.
- Click Sync → Synchronize to trigger the deployment.
How the Sync Process Works
When you execute argocd app sync or enable automated sync policies, the Application Controller performs the following reconciliation loop as implemented in server/application/application.go:
- Render: The controller requests the Repo Server to pull the source and render final manifests (resolving Helm values, Kustomize overlays, or Jsonnet).
- Compare: Compares the rendered manifests against the live cluster state using the Kubernetes API.
- Apply: Executes a
kubectl apply-style operation to create or update resources on the target cluster. - Status: Updates the Application CRD status to
SyncedorOutOfSync, reporting health and resource synchronization state.
The controller also supports automated policies including pruning (removing resources not in Git), self-healing (correcting drift), and retry logic for failed syncs.
Summary
- Argo CD deploys applications by reconciling Git repository state with Kubernetes cluster state using the Application Controller in
server/application/application.go. - Deploy applications using either the CLI (
argocd app createfollowed byargocd app sync) or the web UI. - The Repo Server handles manifest rendering for Helm, Kustomize, Jsonnet, and plain YAML sources.
- Applications are stored as lightweight CRDs that specify source repositories, destination clusters, and sync policies.
- Automated sync policies enable continuous delivery without manual intervention.
Frequently Asked Questions
What is the difference between argocd app create and argocd app sync?
argocd app create registers a new Application CRD with Argo CD, defining the source repository, path, and destination cluster without deploying resources. argocd app sync triggers the actual deployment by invoking the Application Controller to apply manifests to the target cluster. As implemented in the source code, creation stores metadata while sync executes the reconciliation logic.
Can Argo CD deploy applications to external clusters?
Yes. Argo CD can deploy to any Kubernetes cluster, not just the one it runs in. You must register external clusters using argocd cluster add or the UI. The Application CRD stores the destination cluster URL (e.g., https://kubernetes.default.svc for in-cluster or an external API endpoint), and the Application Controller uses these credentials to execute sync operations remotely.
Does Argo CD support Helm values files?
Yes. Argo CD fully supports Helm deployments through the Repo Server component. You can specify values files using --values flags or inline values using --helm-set parameters in the CLI. The Repo Server (server/repository/repository.go) renders the Helm chart with these values before the Application Controller applies the resulting manifests to the cluster.
How does Argo CD handle application updates?
Argo CD continuously monitors the configured Git repository for commits. When changes are detected, the Application Controller marks the application as OutOfSync. If automated sync is enabled, the controller automatically re-renders manifests and applies changes. Otherwise, manual intervention via argocd app sync or the UI Sync button is required to update the live cluster state.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →