Skip to content

What is ArgoCD

Key idea:

ArgoCD — most popular GitOps tool for Kubernetes (CNCF graduated 2022). An agent in the cluster continuously compares Git state vs actual, applies diffs. Nice web UI with visualisation of health/sync status. Typical setup: 1 ArgoCD install manages multiple clusters/apps. Scale: Intuit uses ArgoCD for 1000+ apps. Alternatives: Flux CD (simpler, pull-based).

Below: details, example, related terms, FAQ.

Check your site →

Details

  • Application CRD: points Git repo path → K8s namespace
  • ApplicationSet: generate apps for multi-env (dev/staging/prod)
  • App of apps: one app manages many (hierarchical)
  • Sync waves: ordered resource creation (order annotations)
  • Notifications: Slack/Teams on sync events

Example

# App of apps bootstrap
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: bootstrap
spec:
  source:
    repoURL: git@github.com:me/manifests
    path: apps/        # contains more Application CRDs
    targetRevision: HEAD
  destination: { server: https://kubernetes.default.svc, namespace: argocd }
  syncPolicy: { automated: { prune: true } }

Related Terms

Understanding ArgoCD Architecture

ArgoCD operates on a client-server architecture, where the ArgoCD server interacts with both the Kubernetes API and the Git repository. The server is responsible for managing the application lifecycle and syncing state between the Git repository and the Kubernetes cluster.

At its core, ArgoCD consists of the following components:

  • API Server: The main entry point for clients, exposing RESTful APIs to interact with ArgoCD functionalities.
  • Application Controller: Continuously monitors the state of applications, comparing the desired state in Git with the actual state in the cluster.
  • Repo Server: Handles Git operations, such as fetching application manifests, and serves them to the API server.
  • Web UI: A user-friendly interface that visualizes application health, sync status, and provides a dashboard for managing multiple applications.

ArgoCD utilizes a Declarative Configuration Model. Applications are defined using Kubernetes manifests stored in Git, ensuring that the desired state is always maintained. When discrepancies are found, the Application Controller applies the necessary changes to bring the cluster back to the desired state.

Getting Started with ArgoCD: Practical Commands

To get started with ArgoCD, follow these practical commands to install and configure your first application. This guide assumes you have a Kubernetes cluster and kubectl configured.

1. Install ArgoCD

First, apply the ArgoCD installation manifest:

kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml

After installation, expose the ArgoCD API server:

kubectl port-forward svc/argocd-server -n argocd 8080:443

Access the ArgoCD UI at http://localhost:8080. The default username is admin. Retrieve the initial password:

kubectl get pods -n argocd -l app.kubernetes.io/instance=argocd-server -o jsonpath='{.items[0].metadata.name}' | xargs -I {} kubectl exec -n argocd {} -c argocd-server -- argo-cd admin initial-password

2. Create Your First Application

Once logged in, create an application using the following command:

argocd app create my-app --repo https://github.com/my-org/my-repo.git --path k8s --dest-server https://kubernetes.default.svc --dest-namespace default

3. Sync the Application

To sync the application and bring the cluster to the desired state, run:

argocd app sync my-app

4. Monitor Application Status

Check the application's health and status:

argocd app get my-app

By following these commands, you can quickly set up and manage applications using ArgoCD, embracing the GitOps methodology.

ArgoCD Best Practices for Effective GitOps

Implementing ArgoCD effectively requires adherence to best practices that enhance performance, security, and maintainability. Here are several key practices to consider:

  • Use Git as the Single Source of Truth: Ensure that all Kubernetes manifests and configurations are stored in Git. This centralization simplifies versioning and auditing.
  • Implement RBAC: Utilize Kubernetes Role-Based Access Control (RBAC) to restrict access to ArgoCD resources. Define roles and permissions carefully to prevent unauthorized changes.
  • Automate Syncing: Enable automatic synchronization by setting up the --sync-policy flag in your application configuration. This ensures that any changes in Git are automatically reflected in the cluster.
  • Leverage Application Sets: Use ArgoCD ApplicationSets to manage multiple applications with similar configurations, reducing redundancy and simplifying management.
  • Monitor Resource Usage: Regularly monitor the resource consumption of ArgoCD components to ensure optimal performance. Tools like Prometheus and Grafana can be integrated for enhanced observability.
  • Version Control for Manifests: Tag and version your manifests in Git to facilitate rollback capabilities. This allows you to revert to a previous state quickly if necessary.

By implementing these best practices, organizations can maximize the benefits of ArgoCD, leading to a more robust and efficient GitOps workflow.

Learn more

Frequently Asked Questions

ArgoCD vs Flux?

ArgoCD: better UI, UI-driven adoption. Flux: simpler, native cross-cluster. Enterprise often ArgoCD (UI for devs). Platform teams often Flux.

Multi-cluster?

ArgoCD manages multiple clusters from one UI. Needs credentials. Alternative — instance per cluster.

Scaling limits?

Default configs: ~1000 apps per instance. Large setups — shard controllers by clusters/projects.

Try the live tool that powered this guide

Free plan — 10 monitors, checks every 5 min, no card required. Upgrade for 1-minute interval and multi-region monitoring.