Task 2 - Kubernetes projet
Go to file
2025-04-15 21:08:38 +00:00
public Téléverser les fichiers vers "public" 2025-04-15 20:12:35 +00:00
deployment.yaml Add 2025-04-15 20:11:51 +00:00
Dockerfile Add 2025-04-15 20:11:51 +00:00
namespace.yaml Add 2025-04-15 20:11:51 +00:00
package-lock.json Add 2025-04-15 20:11:51 +00:00
package.json Add 2025-04-15 20:11:51 +00:00
prepare-app.sh Add 2025-04-15 20:11:51 +00:00
README.md Actualiser README.md 2025-04-15 21:08:38 +00:00
server.js Add 2025-04-15 20:11:51 +00:00
service.yaml Add 2025-04-15 20:11:51 +00:00
start-app.sh Add 2025-04-15 20:11:51 +00:00
statefulset.yaml Add 2025-04-15 20:11:51 +00:00
stop-app.sh Add 2025-04-15 20:11:51 +00:00

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

  1. 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```