Production-oriented DevOps and Kubernetes learning project for deploying a small e-commerce workload end to end.
This repository is organized branch-wise to show two deployment approaches:
| Branch | Purpose | Deployment Model |
|---|---|---|
helm |
Kubernetes deployment using Helm from Jenkins | Jenkins builds, scans, pushes images, and deploys the Helm chart directly |
argocd |
GitOps deployment using ArgoCD | Jenkins builds, scans, pushes images, updates Git, and ArgoCD deploys from Git |
CloudCart includes:
- Containerized frontend and backend applications
- Kubernetes deployment with Helm
- GitOps deployment with ArgoCD on the
argocdbranch - PostgreSQL StatefulSet with persistent storage
- Redis cache
- Ingress, HPA, PDB, RBAC, ConfigMaps, Secrets, and NetworkPolicies
- Jenkins pipeline for CI, image scanning, image publishing, and deployment promotion
- Prometheus, Grafana, Alertmanager, Loki, Promtail, application metrics, and pod logs
- Trivy image scanning and operational runbooks
- Kyverno policy enforcement for admission-time platform guardrails
- Backstage catalog metadata and TechDocs setup
- Backup, rollback, and troubleshooting scripts
flowchart LR
Dev["Developer"] --> GitHub["GitHub"]
GitHub --> Jenkins["Jenkins"]
Jenkins --> Scan["Tests + Trivy"]
Scan --> Registry["Container Registry"]
Jenkins --> Helm["Helm Upgrade"]
Helm --> K8s["Kubernetes"]
User["User"] --> Ingress["Ingress NGINX"]
Ingress --> Frontend["Frontend"]
Ingress --> Backend["Backend API"]
Backend --> Postgres["PostgreSQL PVC"]
Backend --> Redis["Redis"]
Prometheus["Prometheus"] --> Backend
Grafana["Grafana"] --> Prometheus
flowchart LR
Dev["Developer"] --> GitHub["GitHub"]
GitHub --> Jenkins["Jenkins"]
Jenkins --> Test["Backend Tests"]
Test --> Build["Docker Build"]
Build --> Scan["Trivy Scan"]
Scan --> Registry["GitHub Container Registry"]
Jenkins --> GitOps["Update values-gitops.yaml"]
GitOps --> GitHub
GitHub --> ArgoCD["ArgoCD"]
ArgoCD --> Helm["Render Helm Chart"]
Helm --> K8s["Kubernetes"]
User["User"] --> Ingress["Ingress NGINX"]
Ingress --> Frontend["Frontend"]
Ingress --> Backend["Backend API"]
Backend --> Postgres["PostgreSQL PVC"]
Backend --> Redis["Redis"]
Prometheus["Prometheus"] --> Backend
Grafana["Grafana"] --> Prometheus
Choose the branch based on the deployment model you want to run.
For Helm-based Kubernetes deployment:
git checkout helmFor ArgoCD-based GitOps deployment:
git checkout argocd-
Build and test locally:
cd app/backend npm test npm start
-
Build images:
docker build -t cloudcart-backend:local app/backend docker build -t cloudcart-frontend:local app/frontend
-
Run the redesigned frontend with Docker:
docker network create cloudcart-network docker run -d --name cloudcart-backend --network cloudcart-network cloudcart-backend:local docker run -d --name cloudcart-frontend --network cloudcart-network -p 8080:80 cloudcart-frontend:local
Open:
http://localhost:8080 -
Deploy with Helm on the
helmbranch:helm upgrade --install cloudcart helm/cloudcart \ --namespace cloudcart \ --create-namespace \ --set backend.image.repository=cloudcart-backend \ --set backend.image.tag=local \ --set frontend.image.repository=cloudcart-frontend \ --set frontend.image.tag=local
-
Deploy with ArgoCD on the
argocdbranch:argocd app create cloudcart \ --repo https://github.com/Pushpendra2601/CloudCart-Ecomm.git \ --revision argocd \ --path helm/cloudcart \ --dest-server https://kubernetes.default.svc \ --dest-namespace cloudcart \ --values values.yaml \ --values values-gitops.yaml \ --sync-option CreateNamespace=true
argocd app sync cloudcart argocd app wait cloudcart --health --timeout 300 -
Verify:
kubectl get pods -n cloudcart kubectl get ingress -n cloudcart
The project demonstrates two delivery patterns.
On the helm branch:
- Jenkins checks out the repository.
- Jenkins runs backend tests.
- Jenkins builds backend and frontend Docker images.
- Jenkins scans images with Trivy.
- Jenkins pushes immutable tags to GitHub Container Registry.
- Jenkins deploys the Helm chart directly to Kubernetes.
- Jenkins verifies rollout status.
On the argocd branch:
- Jenkins checks out the repository.
- Jenkins runs backend tests.
- Jenkins builds backend and frontend Docker images.
- Jenkins scans images with Trivy.
- Jenkins pushes immutable tags to GitHub Container Registry.
- Jenkins updates
helm/cloudcart/values-gitops.yamlwith the new image tag. - Jenkins commits and pushes the GitOps change.
- ArgoCD detects the Git change and syncs Kubernetes.
GET /healthz: liveness probeGET /readyz: readiness probeGET /metrics: Prometheus metricsGET /api/products: product catalogPOST /api/orders: create an order
helm: Helm-based Kubernetes deployment flowargocd: GitOps deployment flow with ArgoCD- Jenkins builds immutable image tags as
BUILD_NUMBER-GIT_SHORT_SHA - Helm branch deploys directly with Helm
- ArgoCD branch deploys by updating Git and letting ArgoCD reconcile Kubernetes state
- Rollback in the Helm flow is handled through Helm release history
- Rollback in the GitOps flow is handled through Git revert or ArgoCD sync history