How iquantc/github_actions_argocd_gitops works
What this project is (type + purpose)
This repo is a GitOps CI/CD reference implementation for a containerized Node.js app deployed to Kubernetes via Argo CD, with GitHub Actions building/pushing images and optionally triggering Argo CD sync.
Runtime architecture (how traffic reaches the Node app in Kubernetes)
2) Delivery architecture (how code changes become a deployed workload: GitHub → Actions → Registry → Argo CD → Kubernetes)
Read the file tree as “system components”
• app.js
The application runtime entrypoint (Node HTTP server; README mentions /hello route).
• package.json, package-lock.json
Node dependencies/build metadata (important for the image build stage).
• Dockerfile
Container build definition (turns Node app into an immutable artifact).
• .github/workflows/argo-actions.yml
CI pipeline definition (build, push, and Argo CD operations).
• manifest/deployment.yaml
Kubernetes Deployment (declares Pods, container image tag, replicas, etc).
• manifest/service.yaml
Kubernetes Service (exposes Deployment internally; README shows port-forwarding; could be NodePort/LoadBalancer depending on edits).
This gives you clear boundaries: Source → CI → Artifact Registry → GitOps Manifests → CD Controller → Cluster Resources.
Developer / SCM layer
• Developer workstation
• GitHub Repository (this repo)
• Branch (e.g., main) as the “source of truth”
• Contains:
• app source (app.js)
• Docker build definition (Dockerfile)
• deployment definition (manifest/*)
• pipeline definition (.github/workflows/*)
• Developer → GitHub: git push (code + manifest changes)
CI layer (GitHub Actions)
• GitHub Actions workflow (.github/workflows/argo-actions.yml)
1. Checkout repo
2. Docker build (uses Dockerfile, package*.json, app.js)
3. Docker login (uses DOCKERHUB_USERNAME, DOCKERHUB_TOKEN)
4. Docker push image to DockerHub
5. (Option A) Update manifest/deployment.yaml image tag and commit back (classic GitOps)
6. (Option B) Call argocd app sync ... (imperative trigger; still GitOps-ish but less “pure”)
External dependencies to show
• Secrets store: GitHub Actions Secrets
• DOCKERHUB_USERNAME, DOCKERHUB_TOKEN
• ARGOCD_SERVER, ARGOCD_USERNAME, ARGOCD_PASSWORD
• GitHub Actions → DockerHub: push image
• GitHub Actions → GitHub Repo: commit manifest update (if implemented)
• GitHub Actions → Argo CD API: argocd login and argocd app sync (if implemented)
Artifact layer (Container Registry)
• DockerHub repository (image registry)
• Stores versioned images (tags)
• This is what Kubernetes ultimately pulls
• DockerHub → Kubernetes nodes: image pull (kubelet/container runtime)
CD / GitOps layer (Argo CD)
• Argo CD (running in Kubernetes namespace argocd)
• argocd-server (UI/API endpoint you port-forward / NodePort to)
• argocd-repo-server (fetches Git repo)
• argocd-application-controller (reconciles desired vs live state)
• Argo CD Application
• Name (example in README): argocd-github-actions / my-app
• Watches:
• Repo URL
• Branch/revision: main
• Path: manifest
• Sync policy: automatic, with prune/self-heal (per README)
• Argo CD → GitHub Repo: pulls manifests from manifest/
• Argo CD → Kubernetes API: applies/updates resources (Deployment/Service)
Infrastructure / compute layer (as described in README)
The README’s setup is specific and should be drawn explicitly:
• AWS EC2 Ubuntu instance
• Runs:
• Docker
• Minikube (Kubernetes cluster)
• kubectl (admin client)
• This EC2 instance is the “host” for the cluster in the tutorial.
• Minikube Kubernetes Cluster
• Namespace: argocd
• Workloads:
• Argo CD components
• Your app Deployment/Pods
• Your app Service
• User (browser) → EC2 Public IP ports (8080/30007/30008/3000 etc): depends on exposure method
• kubectl (operator) → Kubernetes API: apply/install, port-forward
Runtime request path (the “/hello” flow)
Live traffic path clearly:
User Browser
2. Service exposure method (pick what matches your manifests + README step you want to document)
• Port-forward (common in the README):
• Browser → PublicIP:8080
• kubectl port-forward tunnels to Service
• Or NodePort (Argo CD UI exposure)
• Or Ingress (optional add-on mentioned)
Node.js app (app.js) serving /hello
• Browser → Service → Pod → Response
Relationships & interactions to emphasize (what makes the architecture “GitOps” here)
• Desired state: Git repo (manifest/)
• Actual state: Kubernetes cluster (live resources)
• Reconciler: Argo CD (continuously compares and fixes drift if self-heal enabled)
artifact traceability chain:
• Commit SHA / version → Image tag → Deployment image reference → Running Pod
• Developer
• GitHub
• GitHub Actions
• DockerHub
• Argo CD
• Kubernetes (Minikube on EC2)
• End user/browser
• Developer
• GitHub
• GitHub Actions
• DockerHub
• Argo CD
• Kubernetes API
Steps:
• commit
• workflow triggers
• build image
• push image
• update manifest (or not)
• Argo pulls repo
• Argo applies manifests
• cluster pulls image
• rollout
Inside “Minikube cluster”:
• Namespace argocd:
• Argo CD components (server/controller/repo-server)
• Your app Deployment → ReplicaSet → Pods
• Your app Service
• Exposure:
• port-forward / NodePort / Ingress (choose what you actually used)
Concrete labeling guidance (tie labels to repo files + README)
• “GitHub Actions Workflow: .github/workflows/argo-actions.yml”
• “K8s Deployment: manifest/deployment.yaml (image: <dockerhub>/<repo>:<tag> )”
• “K8s Service: manifest/service.yaml (ports …)”
• “Node app endpoint: /hello from app.js”
• “Argo CD App path: manifest/, revision: main”
• “Secrets: DOCKERHUB_*, ARGOCD_* (GitHub Actions Secrets)”
“Separate into as many components as possible” (without overthinking)
• GitHub Actions Runner (ephemeral runner VM)
• GitHub Actions Secrets (distinct node)
• Argo CD server vs controller vs repo-server
• Kubernetes API Server (even in Minikube)
• NodePort/port-forward tunnel as a first-class component
• Namespace boundaries (argocd)
• Security group / inbound ports on EC2 (since README relies on opening ports)