Skip to main content

Argo CD

Declarative GitOps continuous delivery for Kubernetes. Argo CD watches your Git repositories and automatically syncs your cluster to match, with a rich web UI, RBAC, and Helm/Kustomize support.

✓ Git as source of truth ✓ Helm + Kustomize native ✓ Auto-sync + self-heal ✓ RBAC + SSO

Installing Argo CD via Helm

# Add the Argo CD Helm repository
helm repo add argo https://argoproj.github.io/argo-helm
helm repo update

# Create namespace and install
kubectl create namespace argocd
helm install argocd argo/argo-cd \
  --namespace argocd \
  --set server.service.type=LoadBalancer \
  --set configs.params."server\.insecure"=true  # for local dev only

# Get the initial admin password
kubectl get secret argocd-initial-admin-secret -n argocd \
  -o jsonpath="{.data.password}" | base64 -d

# Access the UI (if using port-forward)
kubectl port-forward svc/argocd-server -n argocd 8080:443
# Open: https://localhost:8080 (admin / password from above)

# Install the argocd CLI
brew install argocd   # macOS
argocd login localhost:8080 --username admin --password YOUR_PASSWORD --insecure

Deploying Your First Application

Create an Application manifest that tells Argo CD which Git repo to watch and which cluster/namespace to sync to:

# application.yaml — point Argo CD at your Git repo
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  project: default

  # Where to get the manifests
  source:
    repoURL: https://github.com/my-org/my-app-config
    targetRevision: HEAD
    path: k8s/production

  # Where to deploy
  destination:
    server: https://kubernetes.default.svc
    namespace: my-app

  # Sync policy
  syncPolicy:
    automated:
      prune: true      # delete resources removed from Git
      selfHeal: true   # revert manual changes
    syncOptions:
      - CreateNamespace=true

kubectl apply -f application.yaml -n argocd

Helm Chart Deployment

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: nginx-ingress
  namespace: argocd
spec:
  project: default
  source:
    repoURL: https://kubernetes.github.io/ingress-nginx
    chart: ingress-nginx
    targetRevision: 4.10.0
    helm:
      releaseName: ingress-nginx
      values: |
        controller:
          replicaCount: 2
          service:
            type: LoadBalancer
          metrics:
            enabled: true
          podAnnotations:
            prometheus.io/scrape: "true"
  destination:
    server: https://kubernetes.default.svc
    namespace: ingress-nginx
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
      - CreateNamespace=true

Kustomize Overlays

# Git repo structure for Kustomize overlays:
# k8s/
#   base/
#     deployment.yaml
#     service.yaml
#     kustomization.yaml
#   overlays/
#     dev/
#       kustomization.yaml    # patches: replicas=1, image=dev-tag
#     production/
#       kustomization.yaml    # patches: replicas=3, image=stable-tag

# Argo CD Application for production overlay:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app-production
  namespace: argocd
spec:
  source:
    repoURL: https://github.com/my-org/my-app-config
    targetRevision: HEAD
    path: k8s/overlays/production   # Argo CD auto-detects kustomization.yaml
  destination:
    server: https://kubernetes.default.svc
    namespace: my-app-production
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

Argo CD vs Flux

Feature Argo CD Flux v2
Web UI Yes (rich) No (CLI only)
CLI argocd CLI flux CLI
Helm support Yes (native) Yes (HelmRelease CRD)
Multi-tenancy Projects + RBAC Namespace isolation
ApplicationSet Yes No (use Kustomize)
Resource footprint Medium (~500MB) Light (~200MB)
Best for Teams wanting UI + visibility Pure GitOps purists, lightweight

RBAC and SSO Setup

# argocd-rbac-cm ConfigMap (in argocd namespace)
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-rbac-cm
  namespace: argocd
data:
  policy.default: role:readonly
  policy.csv: |
    # Admins: full access
    p, role:admin, applications, *, */*, allow
    p, role:admin, clusters, *, *, allow
    p, role:admin, repositories, *, *, allow

    # Developers: sync apps but no delete
    p, role:developer, applications, get, */*, allow
    p, role:developer, applications, sync, */*, allow
    p, role:developer, applications, create, */*, allow
    p, role:developer, applications, update, */*, allow

    # Map GitHub team to role
    g, my-org:ops-team, role:admin
    g, my-org:dev-team, role:developer

Frequently Asked Questions

What is GitOps and why use Argo CD for it?▼

GitOps is a deployment methodology where the desired state of your infrastructure and applications is stored in Git as the single source of truth. Changes happen through pull requests, not manual kubectl commands. Argo CD implements GitOps for Kubernetes by continuously watching your Git repo and reconciling the cluster state to match. If someone manually changes something in the cluster (drift), Argo CD detects it and can automatically revert it. Benefits: full audit trail in Git, easy rollbacks (git revert), PR-based approvals, and self-healing clusters.

How does Argo CD handle Helm chart deployments?▼

Argo CD has native Helm support — point an Application at a Helm chart (from a Helm repo, OCI registry, or Git path) and Argo CD renders the chart with your values.yaml, then syncs the resulting manifests to the cluster. You can override values in the Application spec using helm.values or helm.parameters. Argo CD also supports ApplicationSets to deploy the same Helm chart to multiple clusters or environments with different values, making multi-environment Helm deployments manageable from a single config.

What is the difference between Argo CD and Flux?▼

Both are GitOps tools for Kubernetes, but they differ in design philosophy. Argo CD has a rich web UI, CLI, and REST API making it more accessible and visible — great for teams who want a control plane dashboard. Flux is UI-less, purely CRD/controller-based, more lightweight, and follows a strict GitOps push model. Argo CD supports both push (webhook-triggered) and pull (periodic polling) sync. Flux v2 is more modular and composable. For teams wanting visibility and a UI, Argo CD is the standard choice. Flux is preferred in environments where all configuration must live exclusively in Git.

How do I configure auto-sync, pruning, and self-healing?▼

In the Application spec set: syncPolicy.automated.prune: true (delete resources removed from Git), syncPolicy.automated.selfHeal: true (revert manual changes to match Git). Auto-sync without selfHeal means Argo CD syncs when Git changes but ignores manual edits. Auto-sync with selfHeal means any cluster drift is reverted within the sync interval (default 3 minutes). Be careful with prune in production — a misconfigured Application could delete production resources if Git accidentally removes manifests.

How does Argo CD RBAC work?▼

Argo CD has its own RBAC system on top of Kubernetes RBAC. You define roles in the argocd-rbac-cm ConfigMap using a policy.csv format. Built-in roles are role:readonly (view only) and role:admin (full access). You can create custom roles like role:developer that can sync applications but not delete them. SSO integration (Dex, OIDC, GitHub, Google, LDAP) lets you map identity provider groups to Argo CD roles — for example, map the GitHub team 'ops-team' to role:admin and 'dev-team' to a custom role:developer.

What is an ApplicationSet and when should I use it?▼

ApplicationSet is a controller that generates multiple Argo CD Applications from a single template using generators. The List generator creates apps from a static list; the Git generator discovers apps from directory structure or JSON files in a Git repo; the Cluster generator creates an app per registered cluster. Use ApplicationSets when you need the same application deployed to multiple environments (dev/staging/prod) or multiple clusters with different values, avoiding repetitive Application YAML. It is the standard way to manage fleet-scale deployments.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$9/mo after trial · Cancel anytime

Want the full toolkit?

Get DevPlaybook Pro

Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →