This project demonstrates a production-style DevOps pipeline for deploying a React application. The application is containerized using Docker, built and deployed automatically using Jenkins CI/CD, and deployed to Kubernetes with a LoadBalancer service.
The pipeline integrates GitHub, Jenkins, DockerHub, and Kubernetes to automate the application lifecycle.
Developer → GitHub → Jenkins CI/CD → DockerHub → Kubernetes Cluster → LoadBalancer → Users
- React (Frontend application)
- Docker (Containerization)
- Jenkins (CI/CD automation)
- GitHub (Version control)
- DockerHub (Container registry)
- Kubernetes (Container orchestration)
- AWS EC2 (Jenkins server)
Trend/
│
├── dist/ # Built React application
├── Dockerfile # Docker image configuration
├── Jenkinsfile # Jenkins CI/CD pipeline
├── deployment.yaml # Kubernetes deployment
├── service.yaml # Kubernetes LoadBalancer service
└── README.md
git clone https://github.com/Junaid-dot-max/Trend.git
cd TrendFROM nginx:alpine
COPY dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
Build Docker Image
docker build -t <dockerhub-username>/trend-react-app:latest .
Run Container
docker run -p 3000:80 <dockerhub-username>/trend-react-app
Application will run at:
http://localhost:3000
Login to DockerHub
docker login
Push image
docker push <dockerhub-username>/trend-react-app:latest
Jenkins automates:
- Pull latest code from GitHub
- Build Docker image
- Push image to DockerHub
- Deploy application to Kubernetes
Pipeline stages:
Checkout
Build Image
Push Image
Deploy to Kubernetes
Creates a deployment with 2 replicas of the application.
kubectl apply -f deployment.yaml
Exposes the application using a Kubernetes LoadBalancer.
kubectl apply -f service.yaml
Get service external IP:
kubectl get svc
Example output:
NAME TYPE CLUSTER-IP EXTERNAL-IP
trend-service LoadBalancer 10.100.xx.xx 34.xx.xx.xx
Open in browser:
http://<EXTERNAL-IP>
- Developer pushes code to GitHub
- Jenkins pipeline is triggered
- Jenkins builds Docker image
- Image pushed to DockerHub
- Kubernetes deployment updated
- Application becomes available via LoadBalancer
- Git
- Docker Pipeline
- Kubernetes
- Pipeline
- Blue Ocean
- DockerHub authentication via Jenkins credentials
- SSH key authentication used for EC2 access
Prometheus and Grafana can be integrated with Kubernetes to monitor:
- Pod health
- CPU usage
- Memory usage
- Application uptime
✔ React application containerized using Docker ✔ CI/CD pipeline implemented with Jenkins ✔ Docker images stored in DockerHub ✔ Application deployed to Kubernetes ✔ LoadBalancer exposes the application to users
Junaid Ahamed DevOps Deployment Project