This project demonstrates the deployment of a multi-service application using Kubernetes. The application consists of several microservices, including Stocks, Capital-Gains, MongoDB, and NGINX, orchestrated using Kubernetes.
Based off of Reichman Computer Science University Kubernetes assignment found at: yanivNaor92/cloud-computing
- Architecture
- Prerequisites
- Setup
- Deploying the Application
- Testing the Application
- Cleaning Up
- Directory Structure
- Accessing the Application
The application consists of the following services:
- Stocks Service: Manages stock data and provides RESTful APIs to create, read, update, and delete stock entries.
- Capital-Gains Service: Calculates the capital gains for stocks managed by the Stocks service.
- MongoDB: A NoSQL database used to persistently store stock data.
- NGINX: Acts as a reverse proxy server, routing incoming HTTP requests to the appropriate backend services.
- The following diagram shows a high-level architecture of the system you need to implement.

Before continuing, ensure you have the following tools installed on your computer:
- Clone the Repository:
git clone https://github.com/HershelT/Cloud-Computing-Elective/tree/main/Project3
- Deploy everything:
Make sure docker engine is running and execute the following command in bash:
This will run all the deployments necessary, including assigning a namespace, etc.
./deploy.sh
- Testing using PyTest:
To test the application, run the following command:
pytest -v multi-service-app/tests/assn3_tests.py
- Delete the Kubernetes Cluster:
To delete the Kubernetes cluster, run the following command:
kind delete cluster --name kind
The project directory structure is as follows:
├── kind-config.yaml
├── deploy.sh
├── test_stocks.py
├── README.md
├── architecture.png
|── test-submission.sh
├── multi-service-app/
│ ├── namespace.yaml
│ ├── stocks/
│ │ ├── deployment.yaml
│ │ ├── service.yaml
│ │ └── app.py
│ │ └── Dockerfile
│ ├── capital-gains/
│ │ ├── deployment.yaml
│ │ ├── service.yaml
│ │ └── app.py
│ │ └── Dockerfile
│ ├── database/
│ │ ├── deployment.yaml
│ │ ├── service.yaml
│ │ ├── persistentVolume.yaml
│ │ ├── persistentVolumeClaim.yaml
│ ├── nginx/
│ │ ├── deployment.yaml
│ │ ├── service.yaml
│ │ ├── configmap.yaml
│ ├── tests/
│ │ ├── assn3_tests.py
│ │ ├── stocks_list.py
-
Accessing All Services Through NGINX:
To access the Stocks service, open a web browser and navigate to
http://127.0.0.1:80/.Check out the nginx/configmap.yaml file to see how the NGINX server is configured to route incoming requests to the appropriate backend services. (example: /stocks, /capital-gains, etc.)
This project is licensed under the MIT License - All Asignments are given in the Reichman University Cloud Computing and Software Engineering Class