A small React + Node.js application created to practice real-world DevOps concepts step by step.
The main goal of this project is not application development. It is to understand how a developer's application moves from source code β Docker β Kubernetes β user.
User
β
βΌ
Ingress
β
ββββββββββ΄βββββββββ
βΌ βΌ
Frontend Service Backend Service
β β
βΌ βΌ
React Pods Node.js Pods
β
βΌ
MongoDB Service
β
βΌ
MongoDB Pod
β
βΌ
PVC
β
βΌ
PV
student-app/
β
βββ frontend/
β βββ src/
β βββ public/
β βββ package.json
β βββ Dockerfile
β βββ .dockerignore
β
βββ backend/
β βββ app.js
β βββ package.json
β βββ Dockerfile
β βββ .dockerignore
β
βββ k8s/
β βββ namespace.yaml
β βββ backend-deployment.yaml
β βββ backend-service.yaml
β βββ frontend-deployment.yaml
β βββ frontend-service.yaml
β βββ mongodb-deployment.yaml
β βββ mongodb-service.yaml
β βββ mongodb-secret.yaml
β βββ configmap.yaml
β βββ secret.yaml
β βββ ingress.yaml
β βββ persistentvolume.yaml
β βββ persistentvolumeclaim.yaml
β
βββ docker-compose.yml
βββ README.md
- React.js
- Node.js
- Express.js
- Docker
- Docker Compose
- Kubernetes
- Minikube
- MongoDB
- Kubernetes Ingress
- ConfigMap
- Secret
- PersistentVolume
- PersistentVolumeClaim
This project is designed to practice:
- Writing Dockerfiles
- Building Docker images
- Running containers
- Port mapping
- Container networking
.dockerignore- Docker Compose
- Namespace
- Deployment
- ReplicaSet
- Pods
- Services
- ClusterIP
- Ingress
- ConfigMap
- Secret
- PersistentVolume
- PersistentVolumeClaim
- MongoDB deployment
- Kubernetes networking
Practice diagnosing:
CrashLoopBackOffImagePullBackOffPendingPods- Service connectivity problems
- Ingress problems
- YAML syntax errors
- Wrong labels/selectors
- Wrong ports
- PVC/PV problems
- Container startup failures
Application Code
β
βΌ
Dockerfile
β
βΌ
Docker Image
β
βΌ
Docker Container
β
βΌ
Docker Compose
β
βΌ
Kubernetes
β
βββ Namespace
β
βββ Deployment
β β
β βΌ
β Pods
β
βββ Service
β
βββ ConfigMap
β
βββ Secret
β
βββ Ingress
β
βββ PV/PVC
β
βΌ
Storage
cd backend
docker build -t student-backend:v1 .Run:
docker run -it \
--name backend-container \
-p 5000:5000 \
student-backend:v1Test:
http://localhost:5000/students
cd frontend
docker build -t student-frontend:v1 .Run:
docker run -it \
--name frontend-container \
-p 3000:3000 \
student-frontend:v1Open:
http://localhost:3000
From the project root:
docker compose up --buildStop:
docker compose downCompose allows the React and Node.js containers to run together.
Container-to-container communication uses the Docker service name:
backend:5000
instead of:
localhost:5000
Start Minikube:
minikube startEnable Ingress:
minikube addons enable ingressCreate the namespace:
kubectl apply -f k8s/namespace.yamlDeploy the application resources:
kubectl apply -f k8s/Check resources:
kubectl get all -n student-appCheck Pods:
kubectl get pods -n student-appCheck Services:
kubectl get svc -n student-appCheck Ingress:
kubectl get ingress -n student-appUsed for non-sensitive configuration such as:
PORT
APP_NAME
API_URL
Used for sensitive values such as:
Database username
Database password
JWT secret
API tokens
Example:
ConfigMap β Normal configuration
Secret β Sensitive configuration
For real production systems, Kubernetes Secrets should be protected with appropriate RBAC, encryption at rest, and preferably an external secret-management solution.
The project also practices:
Pod
β
PVC
β
PV
β
Storage
Provides storage.
Requests storage for an application.
The goal is to understand how stateful applications such as MongoDB can keep data when Pods are recreated.
The application uses Kubernetes Services for internal communication.
React
β
βΌ
backend-service
β
βΌ
Node.js Pods
β
βΌ
mongodb-service
β
βΌ
MongoDB Pod
Ingress provides the external HTTP entry point:
User
β
βΌ
Ingress
βββ / β frontend-service
βββ /api β backend-service
Check everything:
kubectl get all -n student-appCheck Pods:
kubectl get pods -n student-appDetailed Pod information:
kubectl describe pod <pod-name> -n student-appView logs:
kubectl logs <pod-name> -n student-appCheck Services:
kubectl get svc -n student-appCheck Ingress:
kubectl get ingress -n student-appCheck PVC:
kubectl get pvc -n student-appCheck PV:
kubectl get pvCheck Kubernetes events:
kubectl get events -n student-appEnter a running container:
kubectl exec -it <pod-name> -n student-app -- shDuring development, several real-world issues were intentionally/debugged, including:
- Docker Engine connection problems
- Incorrect Dockerfile commands
- Docker port mapping
- Container networking
- React-to-backend communication
- Kubernetes YAML case sensitivity
- Missing Kubernetes resource names
- Ingress port configuration errors
- PersistentVolume spelling errors
- PersistentVolume storage quantity errors
- Kubernetes Service selectors
These troubleshooting exercises are an important part of the project.
Through this project I practiced:
React
β
Node.js
β
Dockerfile
β
Docker Image
β
Docker Container
β
Docker Compose
β
Kubernetes
β
Deployment
β
Pod
β
Service
β
Ingress
β
ConfigMap
β
Secret
β
PV/PVC
The main focus was understanding how each DevOps component connects to the next one, rather than memorizing YAML files.
- Add MongoDB CRUD operations
- Add Kubernetes readiness and liveness probes
- Add CPU/memory requests and limits
- Add Horizontal Pod Autoscaler
- Add NetworkPolicy
- Add Kubernetes Jobs/CronJobs
- Add GitHub Actions CI/CD
- Push images to Docker Hub
- Add Helm charts
- Add Prometheus and Grafana monitoring
- Deploy to a cloud Kubernetes cluster
Aman Kumar Gupta
DevOps / Linux / Cloud Learning Project
GitHub: aman9039
This project is a hands-on DevOps learning project designed to understand how a simple full-stack application can be containerized, connected, deployed, configured, exposed, and troubleshot using Docker and Kubernetes.