Task 2 - Kubernetes projet
public | ||
deployment.yaml | ||
Dockerfile | ||
namespace.yaml | ||
package-lock.json | ||
package.json | ||
prepare-app.sh | ||
README.md | ||
server.js | ||
service.yaml | ||
start-app.sh | ||
statefulset.yaml | ||
stop-app.sh |
Web Application Deployment to Kubernetes
Description
This project deploys a web application to Kubernetes.
Containers Used
- web-app-container: A container running a Node.js application.
Kubernetes Objects
- Namespace:
my-namespace
- Deployment:
web-app-deployment
- StatefulSet:
web-app-statefulset
- Service:
web-app-service
- PersistentVolume:
pv-volume
- PersistentVolumeClaim:
pvc-claim
Virtual Networks and Named Volumes
- The application uses a PersistentVolume and PersistentVolumeClaim to store data.
- The Service exposes the application on port 80.
Container Configuration
- The Dockerfile builds a Node.js application and exposes port 8080.
- The Deployment and StatefulSet use the image
my-web-app:latest
.
Instructions
Prepare the Application
- Run the
prepare-app.sh
script to build the Docker image and create the namespace and persistent volumes.
./prepare-app.sh```
###2. Create the Namespace
```bash
kubectl apply -f namespace.yaml```