Projects › Advanced
CI/CD Pipeline & Kubernetes Deployment
Take any MERN app to production the DevOps way: containers, automated tests and deploys, Kubernetes, and monitoring.
Level: Advanced · Time: 2 weeks · Tech stack: Docker, GitHub Actions, Kubernetes, Helm, Prometheus
Features to build
- Multi-stage Docker images for frontend and backend
- GitHub Actions: lint, test, build, push, deploy
- Kubernetes Deployments, Services, Ingress with TLS
- Autoscaling and zero-downtime rolling updates
- Prometheus + Grafana dashboards and alerts
What you will learn
- Containerisation
- CI/CD
- Kubernetes objects
- Observability
- Secrets management
Step-by-step guide
1. Dockerise
Multi-stage builds: build the React app, serve it with nginx; run the API as a non-root user. Add .dockerignore.
2. CI with GitHub Actions
on: { push: { branches: [main] } }
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: npm ci && npm test
- uses: docker/build-push-action@v6
with: { push: true, tags: "ghcr.io/${{ github.repository }}/api:${{ github.sha }}" }
Tag images with the commit SHA so every deploy is traceable.
3. Kubernetes manifests (or a Helm chart)
Deployment (replicas, resources, readiness/liveness probes), Service, Ingress with cert-manager TLS, ConfigMap + Secret for env vars.
4. Deploy step
After pushing the image, helm upgrade --install app ./chart --set image.tag=$SHA — Kubernetes rolls out without downtime; kubectl rollout undo rolls back.
5. Scale
HorizontalPodAutoscaler on CPU; load-test and watch pods scale.
6. Observe
kube-prometheus-stack: Grafana dashboards for latency, errors and pod health; an alert when the error rate goes up.
Level it up
- GitOps with Argo CD
- Infrastructure with Terraform
- Blue-green or canary deployments
On your resume
- Containerised a MERN app and built a GitHub Actions CI/CD pipeline deploying via Helm to Kubernetes with Ingress TLS, autoscaling, rolling updates and Prometheus/Grafana monitoring.