You are viewing a free preview of this lesson.
Subscribe to unlock all 10 lessons in this course and every other course on LearningBro.
GitOps is an operational framework that uses Git as the single source of truth for declarative infrastructure and applications. ArgoCD is the most popular GitOps tool for Kubernetes. This lesson covers GitOps principles, ArgoCD architecture, Application CRDs, sync strategies, and multi-cluster management.
| Principle | Description |
|---|---|
| Declarative | The entire system is described declaratively in Git |
| Versioned and immutable | Git provides an audit trail of every change |
| Pulled automatically | Agents pull desired state from Git, not pushed by CI |
| Continuously reconciled | Drift is detected and corrected automatically |
┌─────────────────────────────────────────────────────────────┐
│ GitOps Workflow │
│ │
│ Developer ──▶ Git Commit ──▶ Git Repo ──▶ ArgoCD ──▶ K8s │
│ ▲ │ │
│ │ │ │
│ └── Drift detected ─┘ │
└─────────────────────────────────────────────────────────────┘
| Aspect | Traditional CI/CD | GitOps |
|---|---|---|
| Deployment | CI pushes to cluster | Agent pulls from Git |
| Source of truth | CI pipeline config | Git repository |
| Drift detection | Manual / none | Automatic, continuous |
| Rollback | Re-run old pipeline | Git revert |
| Audit trail | Pipeline logs | Git history |
# Create namespace
kubectl create namespace argocd
# Install ArgoCD
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Wait for pods to be ready
kubectl wait --for=condition=ready pod -l app.kubernetes.io/name=argocd-server -n argocd --timeout=120s
# Get initial admin password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d
# Access the UI (port-forward)
kubectl port-forward svc/argocd-server -n argocd 8080:443
# Login via CLI
argocd login localhost:8080
┌───────────────────────────────────────────────────┐
│ ArgoCD │
│ │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ API Server │ │ Application Controller │ │
│ │ (UI + CLI) │ │ (reconciliation loop) │ │
│ └──────────────┘ └──────────────────────────┘ │
│ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ Repo Server │ │ Redis (cache) │ │
│ │ (Git clone) │ │ │ │
│ └──────────────┘ └──────────────────────────┘ │
└───────────────────────────────────────────────────┘
│ │
▼ ▼
┌─────────────┐ ┌──────────────┐
│ Git Repo │ │ Kubernetes │
│ (desired) │ │ (actual) │
└─────────────┘ └──────────────┘
| Component | Role |
|---|---|
| API Server | Exposes the UI and CLI API |
| Application Controller | Watches Applications, compares desired vs actual |
| Repo Server | Clones Git repos and renders manifests |
| Redis | Caches Git repo data for performance |
The Application resource is the core of ArgoCD — it defines what to deploy and where.
Subscribe to continue reading
Get full access to this lesson and all 10 lessons in this course.