Declarative Application Setup
You'll learn: How to define ArgoCD Applications as YAML manifests stored in Git, enabling version-controlled, auditable GitOps workflows.
The GitOps Way to Manage Applications
Until now, you've likely created ArgoCD Applications through the UI or CLI. While convenient for learning, this approach doesn't follow GitOps principles—your Application definitions aren't version-controlled or auditable. Declarative Application Setup means defining your ArgoCD Applications as Kubernetes resources (YAML manifests) stored in Git, just like any other Kubernetes object.
Think of it like this: instead of manually configuring your stereo system every time you turn it on, you save your preferred settings as a preset. With declarative setup, your Application configuration is the "preset" stored in Git.
How It Works
An ArgoCD Application is itself a Kubernetes Custom Resource. You create a YAML file defining the Application resource:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: my-app
namespace: argocd
spec:
project: default
source:
repoURL: https://github.com/yourorg/k8s-manifests
targetRevision: HEAD
path: apps/my-app
destination:
server: https://kubernetes.default.svc
namespace: production
syncPolicy:
automated:
prune: true
selfHeal: true
Commit this to Git, then apply it with kubectl apply -f application.yaml. ArgoCD now manages this Application definition just like it manages your workload manifests—any changes in Git automatically sync to your cluster.
This creates the "App of Apps" pattern: ArgoCD Applications managing other ArgoCD Applications, all declaratively.
Key Takeaway: Declarative Application Setup treats ArgoCD Application definitions as code in Git, enabling full GitOps automation, version control, and auditability for your CD pipeline configuration itself.