diff --git a/Sources/Worktrees b/Sources/Worktrees new file mode 160000 index 0000000..d77c066 --- /dev/null +++ b/Sources/Worktrees @@ -0,0 +1 @@ +Subproject commit d77c06618995b6ada5637e81724b89f8341bc4c2 diff --git a/docs/project/requirements/architecture.md b/docs/project/requirements/architecture.md new file mode 100644 index 0000000..89cd997 --- /dev/null +++ b/docs/project/requirements/architecture.md @@ -0,0 +1,163 @@ +# Architecture + +Un schéma d'implémentation détaillé sera établi pour décrire l'architecture globale de l'infrastructure, y compris les différents composants, leur interaction et leur déploiement. + + +## Application + + +### Proxy: Traefik + +* Application router +* High-availability by fault tolerance +* Load-balancing by requests distribution + ALB ? +* Helm chart +* Version + + +### Application: FastAPI + +* Python + * Version: + * Packaging +* Project management? Poetry? + + +### Databases: PostgreSQL + +* Application is using the well known and battle-tested OSS PostgreSQL database management system. + + FIXME pg version + +* Use a specialized Kubernetes operator to manage the PostgreSQL cluster + + Zalando's **postgres-operator** is chosen because... + FIXME main reason(s) to choose it over alternatives + + Alternative OSS solutions available are: ... + FIXME list alternative solution considered + +* Helm chart +* Single read/write Master / Multi read-only slaves architectur + + It provides both high availability and read load balancing, without the additional complexity of multi-master configuration, which the application doesn't require at the moment. + +* Master failover + + +## Infrastructure + + +### Network + + +#### Application Load Balancer (ALB) + + +#### Virtual Private Cloud (VPC) + +* VPC subnet + + +#### Internet Gateways (IGW) + +* Global egress + + +#### Availability Zones (AZ) + +* 3 availability zones for high availability + + +#### NAT Gateways (NGW) + +* Per AZ egress +* In public subnet + + +#### Subnets + + +##### Public subnets + +* Application access +* Bastion access +* NAT gateways ? + + +##### Private subnets + +* Database +* Admin + + +### Compute + +#### Nodes + +* EC2 compute nodes + * Application nodes + * Database nodes + * Bastion node +* Auto-scaling groups + + +#### Orchestration: Kubernetes + +#### Pods + +##### ReplicaSets + +* Traefik +* Application +* Database +* cert-manager +* Metrics server +* bastion + +##### DaemonSets + +* Any ? + + +### Storage + +#### CSI + +##### EBS + +* For persistent storage needs (application data, logs, and monitoring metrics) AWS Elastic Block Storage (EBS) is used to provide persistent block devices to stateful pods +* To integrate EBS with Kubernetes, the Container Storage Interface is leveraged by using the `aws-ebs-csi-driver` cluster addon from EKS which registers EBS volumes as a backend for K8s Persistant Volumes. + + + +## CI/CD + +### GitHub Actions + + +#### Actions + +#### Workflows + +* Application +* Infrastructure + + +## Observability + +### Log management (ELK/EFK) + +### Metrics (Prometheus/Grafana) + +### Event and alerting + + +## Business continuity & Disaster Recovery + +### TODO Recap HA features + +### Backup + +### Disaster Recovery diff --git a/docs/project/requirements/principles.md b/docs/project/requirements/principles.md new file mode 100644 index 0000000..91c5cbe --- /dev/null +++ b/docs/project/requirements/principles.md @@ -0,0 +1,15 @@ +# Architecture principles + + +## Microservices + +Each functionality of the application has been broken down into autonomous, independent and specialized services. +Each microservice is responsible for a specific part of the application, making it easy to maintain, deploy and scale each component individually. + +Microservices communicate with each other via REST APIs, enabling flexible and decentralized communication. +This architecture allows the application to benefit from greater scalability, resilience and ease of deployment of new features. + +## The Twelve-Factor app methodology + + +## Well-architected frameworks and industry best practices diff --git a/docs/project/requirements/specifications.md b/docs/project/requirements/specifications.md new file mode 100644 index 0000000..247b185 --- /dev/null +++ b/docs/project/requirements/specifications.md @@ -0,0 +1 @@ +# Specifications diff --git a/docs/project/requirements/tech_requirements.md b/docs/project/requirements/tech_requirements.md index 651f961..8643536 100644 --- a/docs/project/requirements/tech_requirements.md +++ b/docs/project/requirements/tech_requirements.md @@ -19,6 +19,15 @@ ### Functional Requirements +#### High Performance Asynchronous API Service (FastAPI) + +- **Requirement**: Develop APIs capable of handling high concurrency. +- **Details**: + - Use FastAPI for its asynchronous features. + - Ensure APIs are scalable and can handle simultaneous requests efficiently. + - Implement proper error handling and validation in API endpoints. + + #### Containerized Microservices Architecture (Kubernetes) - **Requirement**: Implement a scalable and resilient containerized microservices architecture. @@ -37,15 +46,6 @@ - Automate deployment to different environments (staging, production). -#### High Performance Asynchronous API Service (FastAPI) - -- **Requirement**: Develop APIs capable of handling high concurrency. -- **Details**: - - Use FastAPI for its asynchronous features. - - Ensure APIs are scalable and can handle simultaneous requests efficiently. - - Implement proper error handling and validation in API endpoints. - - #### Database High Availability (PostgreSQL) - **Requirement**: Ensure data integrity and availability with database replication and failover. diff --git a/docs/project/requirements/user_stories.md b/docs/project/requirements/user_stories.md index 3337fd0..6b79119 100644 --- a/docs/project/requirements/user_stories.md +++ b/docs/project/requirements/user_stories.md @@ -7,6 +7,7 @@ - Each story should clearly state the 'who', 'what', and 'why' to articulate the needs of different system components or stakeholders (even hypothetical ones). - --> + ## Functional user stories Theses stories try to capture the functional requirements pertinent to the architecture and operation of a robust, scalable, and secure microservices application in a cloud environment.