This project demonstrates a complete GitOps-based deployment workflow for a Django Notes application. We use GitHub Actions for automation and ArgoCD for continuous deployment into an Amazon EKS cluster. Infrastructure is managed using Kustomize for environment-specific manifests.
| Tool | Purpose |
|---|---|
| Django | Backend framework |
| MySQL | Database |
| Nginx | Reverse proxy |
| Docker | Containerization |
| GitHub Actions | Workflow automation |
| Kustomize | Kubernetes overlay management |
| ArgoCD | GitOps-based deployment |
| Amazon EKS | Kubernetes cluster |
.
βββ Dockerfile # Django backend
βββ nginx/Dockerfile # Nginx reverse proxy
βββ docker-compose.yml # Local dev stack
βββ requirements.txt # Python deps
βββ noteapp-kustomize/ # Kustomize base and overlays
β βββ base/
β βββ overlays/{staging,production}/
βββ argocd/
β βββ app-staging.yaml
β βββ app-production.yaml
βββ .github/workflows/
βββ noteapp-gitops-pipelines.yml
- Push to
main(deploys to staging environment) - Manual
workflow_dispatch(triggers production deployment)
- Builds
noteapp-backendandnoteapp-nginxDocker images - Saves them as artifacts
- Loads Docker images
- Spins up app using
docker-compose(MySQL + Django + Nginx) - Verifies availability using
curl
π¦ Output:
MySQL is healthy!
Django is healthy!
Running smoke test...
Smoke test passed!
- Tags images using Git SHA
- Pushes them to DockerHub using secrets
- Updates image tags in
kustomization.yamlusingyq - Commits changes back to repo
Updated image tags to abc1234 in kustomization.yaml- Applies ArgoCD
app-staging.yamlusingkubectl - ArgoCD auto-syncs changes in staging
- Manual trigger deploys production ArgoCD manifest
git clone <repo-url>
cd <repo>cat <<EOF > .env
DATABASE_HOST=db
DATABASE_NAME=test_db
DATABASE_USER=root
DATABASE_PASSWORD=root
DATABASE_PORT=3306
EOFdocker-compose up -dhttp://localhost:80
docker-compose down --volumes| Secret | Description |
|---|---|
DOCKER_USERNAME |
DockerHub login |
DOCKER_PASS |
DockerHub password |
GIT_TOKEN |
Git commit access |
KUBECONFIG |
EKS cluster kubeconfig |
graph TD;
Push[Push to main] --> Build[Docker Build]
Build --> Test[Smoke Test]
Test --> PushRegistry[Push Docker Images]
PushRegistry --> UpdateKustomize[Update kustomization.yaml]
UpdateKustomize --> ArgoCD[ArgoCD Auto Sync]
ArgoCD --> Staging[Staging Deployment]
Staging --> ManualTrigger[Manual Dispatch]
ManualTrigger --> Production[Production Deployment]






