Argo CD GitOps
Declarative continuous delivery for Kubernetes with GitOps workflow.
Overview
Argo CD is a declarative GitOps continuous delivery tool that brings Git-driven deployment workflows to Kubernetes environments. Originally developed by Intuit and now a CNCF graduated project, Argo CD implements the GitOps methodology where Git repositories serve as the single source of truth for application configurations and deployment states. This approach revolutionizes how teams manage Kubernetes deployments by eliminating manual kubectl commands and configuration drift through automated synchronization between Git repositories and cluster states.
This comprehensive stack combines Argo CD's core components with Redis for caching and Dex for identity management to create a production-grade GitOps platform. The argocd-server provides the web UI and API gateway, argocd-repo-server handles Git repository operations and manifest generation, while argocd-application-controller continuously monitors and reconciles application states. Redis serves as the distributed cache and session store, significantly improving performance for large-scale deployments, while Dex enables enterprise-grade authentication through OIDC, SAML, and other identity providers.
This configuration is ideal for DevOps teams, platform engineers, and organizations seeking to implement mature GitOps practices without the complexity of manual Kubernetes installation. Unlike traditional CI/CD tools that push changes to environments, Argo CD pulls desired state from Git repositories, providing better security, auditability, and disaster recovery capabilities. The stack particularly excels in multi-cluster environments where centralized application lifecycle management and consistent deployment practices are critical for operational efficiency.
Key Features
- Declarative GitOps workflow with Git repositories as the source of truth for all deployments
- Real-time application health monitoring with detailed resource status and sync state visibility
- Multi-cluster deployment management from a single Argo CD instance with cluster credential isolation
- Automated drift detection and self-healing capabilities when cluster state deviates from Git
- Pre-sync and post-sync hooks for database migrations, testing, and custom deployment logic
- Role-based access control with project-level permissions and Git repository restrictions
- Application rollback capabilities with Git history-based version management
- SSO integration through Dex supporting OIDC, SAML, GitHub, GitLab, and enterprise identity providers
Common Use Cases
- 1Multi-environment Kubernetes deployments with promotion pipelines from dev to staging to production
- 2Microservices architecture deployment where multiple teams manage independent applications through Git
- 3Infrastructure as Code management for Kubernetes resources including ingress controllers, monitoring, and security policies
- 4Multi-cluster application deployment across different cloud providers or regions with consistent configurations
- 5Disaster recovery scenarios where entire cluster states can be reconstructed from Git repository definitions
- 6Compliance-driven environments requiring audit trails and approval workflows for production changes
- 7Development team self-service platforms where developers deploy applications without direct cluster access
Prerequisites
- Minimum 2GB RAM allocated to Docker (1GB for Argo CD components, 512MB for Redis, plus system overhead)
- Access to Kubernetes cluster with kubectl configured (required for Argo CD to manage applications)
- Git repository with Kubernetes manifests, Helm charts, or Kustomize configurations for applications
- Port 8080 available for Argo CD web interface access
- Basic understanding of Kubernetes concepts including deployments, services, and YAML manifests
- Git repository access credentials and webhook configuration knowledge for automated sync triggers
For development & testing. Review security settings, change default credentials, and test thoroughly before production use. See Terms
docker-compose.yml
docker-compose.yml
1services: 2 argocd-server: 3 image: quay.io/argoproj/argocd:v2.9.34 container_name: argocd-server5 command: argocd-server --staticassets /shared/app6 environment: 7 - ARGOCD_SERVER_INSECURE=true8 - REDIS_SERVER=redis:63799 volumes: 10 - argocd-data:/home/argocd11 - ./repositories:/home/argocd/repo12 ports: 13 - "8080:8080"14 depends_on: 15 - redis16 networks: 17 - argocd-network18 restart: unless-stopped1920 argocd-repo-server: 21 image: quay.io/argoproj/argocd:v2.9.322 container_name: argocd-repo-server23 command: argocd-repo-server --redis redis:637924 volumes: 25 - argocd-repo:/home/argocd26 depends_on: 27 - redis28 networks: 29 - argocd-network30 restart: unless-stopped3132 argocd-application-controller: 33 image: quay.io/argoproj/argocd:v2.9.334 container_name: argocd-controller35 command: argocd-application-controller --redis redis:6379 --repo-server argocd-repo-server:808136 volumes: 37 - argocd-controller:/home/argocd38 depends_on: 39 - argocd-repo-server40 networks: 41 - argocd-network42 restart: unless-stopped4344 redis: 45 image: redis:7-alpine46 container_name: argocd-redis47 volumes: 48 - redis-data:/data49 networks: 50 - argocd-network51 restart: unless-stopped5253 dex: 54 image: ghcr.io/dexidp/dex:v2.37.055 container_name: argocd-dex56 command: dex serve /etc/dex/config.yaml57 volumes: 58 - ./dex-config.yaml:/etc/dex/config.yaml:ro59 networks: 60 - argocd-network61 restart: unless-stopped6263volumes: 64 argocd-data: 65 argocd-repo: 66 argocd-controller: 67 redis-data: 6869networks: 70 argocd-network: 71 driver: bridge.env Template
.env
1# Argo CD2# Note: This is a simplified Docker Compose setup3# For production, deploy to Kubernetes45# Get initial admin password:6# kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -dUsage Notes
- 1Web UI at http://localhost:8080
- 2Login: admin / (get from secret)
- 3GitOps continuous delivery
- 4Sync apps from Git repos
- 5Best run on Kubernetes
Individual Services(5 services)
Copy individual services to mix and match with your existing compose files.
argocd-server
argocd-server:
image: quay.io/argoproj/argocd:v2.9.3
container_name: argocd-server
command: argocd-server --staticassets /shared/app
environment:
- ARGOCD_SERVER_INSECURE=true
- REDIS_SERVER=redis:6379
volumes:
- argocd-data:/home/argocd
- ./repositories:/home/argocd/repo
ports:
- "8080:8080"
depends_on:
- redis
networks:
- argocd-network
restart: unless-stopped
argocd-repo-server
argocd-repo-server:
image: quay.io/argoproj/argocd:v2.9.3
container_name: argocd-repo-server
command: argocd-repo-server --redis redis:6379
volumes:
- argocd-repo:/home/argocd
depends_on:
- redis
networks:
- argocd-network
restart: unless-stopped
argocd-application-controller
argocd-application-controller:
image: quay.io/argoproj/argocd:v2.9.3
container_name: argocd-controller
command: argocd-application-controller --redis redis:6379 --repo-server argocd-repo-server:8081
volumes:
- argocd-controller:/home/argocd
depends_on:
- argocd-repo-server
networks:
- argocd-network
restart: unless-stopped
redis
redis:
image: redis:7-alpine
container_name: argocd-redis
volumes:
- redis-data:/data
networks:
- argocd-network
restart: unless-stopped
dex
dex:
image: ghcr.io/dexidp/dex:v2.37.0
container_name: argocd-dex
command: dex serve /etc/dex/config.yaml
volumes:
- ./dex-config.yaml:/etc/dex/config.yaml:ro
networks:
- argocd-network
restart: unless-stopped
Quick Start
terminal
1# 1. Create the compose file2cat > docker-compose.yml << 'EOF'3services:4 argocd-server:5 image: quay.io/argoproj/argocd:v2.9.36 container_name: argocd-server7 command: argocd-server --staticassets /shared/app8 environment:9 - ARGOCD_SERVER_INSECURE=true10 - REDIS_SERVER=redis:637911 volumes:12 - argocd-data:/home/argocd13 - ./repositories:/home/argocd/repo14 ports:15 - "8080:8080"16 depends_on:17 - redis18 networks:19 - argocd-network20 restart: unless-stopped2122 argocd-repo-server:23 image: quay.io/argoproj/argocd:v2.9.324 container_name: argocd-repo-server25 command: argocd-repo-server --redis redis:637926 volumes:27 - argocd-repo:/home/argocd28 depends_on:29 - redis30 networks:31 - argocd-network32 restart: unless-stopped3334 argocd-application-controller:35 image: quay.io/argoproj/argocd:v2.9.336 container_name: argocd-controller37 command: argocd-application-controller --redis redis:6379 --repo-server argocd-repo-server:808138 volumes:39 - argocd-controller:/home/argocd40 depends_on:41 - argocd-repo-server42 networks:43 - argocd-network44 restart: unless-stopped4546 redis:47 image: redis:7-alpine48 container_name: argocd-redis49 volumes:50 - redis-data:/data51 networks:52 - argocd-network53 restart: unless-stopped5455 dex:56 image: ghcr.io/dexidp/dex:v2.37.057 container_name: argocd-dex58 command: dex serve /etc/dex/config.yaml59 volumes:60 - ./dex-config.yaml:/etc/dex/config.yaml:ro61 networks:62 - argocd-network63 restart: unless-stopped6465volumes:66 argocd-data:67 argocd-repo:68 argocd-controller:69 redis-data:7071networks:72 argocd-network:73 driver: bridge74EOF7576# 2. Create the .env file77cat > .env << 'EOF'78# Argo CD79# Note: This is a simplified Docker Compose setup80# For production, deploy to Kubernetes8182# Get initial admin password:83# kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d84EOF8586# 3. Start the services87docker compose up -d8889# 4. View logs90docker compose logs -fOne-Liner
Run this command to download and set up the recipe in one step:
terminal
1curl -fsSL https://docker.recipes/api/recipes/argo-cd-gitops/run | bashTroubleshooting
- Application stuck in 'Unknown' health status: Check that Kubernetes cluster is accessible and kubectl context is properly configured in the cluster settings
- ComparisonError with 'unable to load data from /tmp/...' messages: Repository server cannot access Git repository, verify SSH keys or HTTPS credentials in repository configuration
- OutOfSync status despite no visible differences: Enable 'IgnoreExtraneous' resource option or check for resources created outside of Argo CD management
- Redis connection timeouts causing slow UI performance: Increase Redis memory allocation or check network connectivity between Argo CD components and Redis container
- Dex authentication failing with OIDC providers: Verify redirect URIs include http://localhost:8080/auth/callback in your identity provider configuration
- 'permission denied' errors during sync operations: Check that Argo CD service account has appropriate RBAC permissions in the target Kubernetes namespace
Community Notes
Loading...
Loading notes...
Download Recipe Kit
Get all files in a ready-to-deploy package
Includes docker-compose.yml, .env template, README, and license
Components
argocd-serverargocd-repo-serverargocd-controllerredisdex
Tags
#gitops#kubernetes#argocd#cd#deployment
Category
DevOps & CI/CDAd Space
Shortcuts: C CopyF FavoriteD Download