Week 10: GitOps — ArgoCD
Theme: Declarative deployment and sync with ArgoCD.
Learning Objectives
- Explain GitOps principles (declarative, versioned, automated sync)
- Install and configure ArgoCD
- Manage application definitions via Git repositories
- Implement sync strategies (auto-sync, prune, self-heal)
Reading Materials
- ArgoCD Documentation
- ArgoCD Getting Started
- ArgoCD Declarative Setup
- GitOps Principles (CNCF)
- ArgoCD Best Practices (Codefresh)
- Weave GitOps
Finger Exercises (choose 2)
- Install ArgoCD in kind. Access the UI via port-forward. Change the admin password.
- Create a Git repo with Kubernetes manifests for the Go app. Point ArgoCD at it. Verify auto-sync.
- Simulate drift: manually edit a Deployment resource in the cluster. Watch ArgoCD self-heal.
Project
Create a GitOps repository (gitops-infra) separate from the app repo:
gitops-infra/
├── apps/
│ ├── go-app/
│ │ ├── deployment.yaml
│ │ ├── service.yaml
│ │ └── kustomization.yaml
│ └── python-worker/
│ ├── deployment.yaml
│ └── kustomization.yaml
├── infrastructure/
│ ├── prometheus/
│ ├── grafana/
│ ├── loki/
│ └── jaeger/
└── argo-apps/
└── all-apps.yaml
- Use Kustomize for environment overlays:
overlays/dev/,overlays/prod/ - Use Helm charts for infrastructure components
- Configure ArgoCD ApplicationSets to create apps from the repository
- Demonstrate:
- Sync the stack to a dev cluster
- Change an image tag in git, push, watch auto-sync
- Rollback a bad deployment using
argocd app rollback
Time Budget
| Activity | Time |
|---|---|
| Reading | 1.5 hrs |
| Finger exercises | 1.5 hrs |
| Project | 3 hrs |
| Total | 6 hrs |