From 9909524bfe55cddf6e67ede3d8461b46cdb70a3a Mon Sep 17 00:00:00 2001 From: Emeline Nerot Date: Wed, 16 Apr 2025 09:50:34 +0000 Subject: [PATCH] Actualiser README.md --- README.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab8b6e5..5fa5e00 100644 --- a/README.md +++ b/README.md @@ -4,11 +4,12 @@ This repository contains the Kubernetes configuration files to deploy my Todo Ap ## Description -The Todo App is a web application for creating, reading, updating, and deleting the task to do. It is built using Node.js and is containerized using Docker. +The Todo App is a web application for creating, reading, updating, and deleting tasks. It is built using Node.js and is containerized using Docker. The application uses a PostgreSQL database to store task data. ## Containers Used - **elineen/todo-app:latest**: The main application container that runs the Todo App. +- **postgres:latest**: The container that runs the PostgreSQL database. ## Kubernetes Objects @@ -16,18 +17,30 @@ The Todo App is a web application for creating, reading, updating, and deleting - **Deployment**: `deployment.yaml` - Defines the deployment configuration for the Todo App. - **StatefulSet**: `statefulset.yaml` - Defines the stateful set configuration for the Todo App, including PersistentVolume and PersistentVolumeClaim objects. - **Service**: `service.yaml` - Exposes the Todo App to the network. +- **Database Deployment**: `db-deployment.yaml` - Defines the deployment configuration for the PostgreSQL database. +- **Database Service**: `db-service.yaml` - Exposes the PostgreSQL database to the network within the cluster. ## Virtual Networks and Named Volumes - **PersistentVolume**: Defines a persistent volume for storing application data. - **PersistentVolumeClaim**: Claims the persistent volume for use by the StatefulSet. +- **Database PersistentVolume**: Defines a persistent volume for storing database data. +- **Database PersistentVolumeClaim**: Claims the persistent volume for use by the PostgreSQL database. ## Container Configuration The container configuration includes the following: -- **Image**: `elineen/todo-app:latest` -- **Ports**: The application listens on port 8080. -- **Volume Mounts**: The container mounts the persistent volume at `/data`. +- **Application Image**: `elineen/todo-app:latest` +- **Database Image**: `postgres:latest` +- **Ports**: The application listens on port 8080. The PostgreSQL database listens on port 5432. +- **Volume Mounts**: The application container mounts the persistent volume at `/data`. The PostgreSQL container mounts the persistent volume at the default data directory. + +## Database Configuration +The application uses a PostgreSQL database to store task data. The database is configured with the following environment variables: + +- **POSTGRES_DB**: mydatabase +- **POSTGRES_USER**: myuser +- **POSTGRES_PASSWORD**: mypassword ## Instructions