ArgoCD

February 13, 2025    GitOps Kubernetes Continuous Delivery DevOps

ArgoCD

What is ArgoCD?

ArgoCD is a declarative, GitOps-based continuous delivery tool for Kubernetes. It automates the deployment and synchronization of applications defined in Git repositories. This document covers its key features and installation steps on Kubernetes clusters.

Key Features of ArgoCD

  • GitOps-based: Uses Git as the source of truth for application state.
  • Automated Synchronization: Ensures deployed applications match the desired state.
  • Multi-Cluster Management: Supports deploying applications across multiple clusters.
  • RBAC & SSO: Provides role-based access control and integrates with Single Sign-On (SSO) providers.
  • Web UI & CLI: Offers a user-friendly dashboard and command-line interface.

Installing ArgoCD on Kubernetes

Step 1: Install ArgoCD

Apply the official ArgoCD manifests:

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

Step 2: Expose the ArgoCD API Server

Use a LoadBalancer, Ingress, or port-forwarding:

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

Step 3: Retrieve Admin Password

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

Step 4: Login to ArgoCD

Use the CLI to authenticate:

argocd login localhost:8080 --username admin --password <PASSWORD>

Deploying an Application with ArgoCD

Step 1: Register a Git Repository

argocd repo add https://github.com/your/repository.git --username <USER> --password <PASSWORD>

Step 2: Create an Application

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

Step 3: Sync the Application

argocd app sync my-app

Step 4: Check Application Status

argocd app get my-app

Example Deployment Manifest

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: my-app
  namespace: argocd
spec:
  destination:
    namespace: default
    server: https://kubernetes.default.svc
  project: default
  source:
    path: k8s-manifests
    repoURL: https://github.com/your/repository.git
    targetRevision: HEAD
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

Conclusion

ArgoCD simplifies application delivery by integrating GitOps principles into Kubernetes environments. By following these steps, you can set up ArgoCD for automated and declarative continuous delivery.