https://github.com/harsh098/microservice-deploy
A set of microservices that convert a Video to MP3 audio developed using Flask, RabbitMQ, MySQL, mongoDB, Docker and Kubernetes
https://github.com/harsh098/microservice-deploy
docker flask kubernetes python
Last synced: 2 months ago
JSON representation
A set of microservices that convert a Video to MP3 audio developed using Flask, RabbitMQ, MySQL, mongoDB, Docker and Kubernetes
- Host: GitHub
- URL: https://github.com/harsh098/microservice-deploy
- Owner: harsh098
- Created: 2022-12-26T13:16:13.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-02-13T00:04:18.000Z (over 3 years ago)
- Last Synced: 2025-03-16T14:48:35.098Z (over 1 year ago)
- Topics: docker, flask, kubernetes, python
- Language: Python
- Homepage:
- Size: 897 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Microservices Project : A Video Converter Service
This project was my first introduction to developing microservices and deploying them to a local **Kubernetes** cluster(**minikube**).
Multiple repos were combined for your convinience.
------
### Sub Repos for each service:-
1. **Main repo** [https://github.com/harsh098/microservice-deploy/](https://github.com/harsh098/microservice-deploy/)
2. **Authentication Service** [https://github.com/harsh098/microservice-deploy-auth](https://github.com/harsh098/microservice-deploy-auth)
3. **Gateway Service** [https://github.com/harsh098/microservice-deploy-gateway-svc](https://github.com/harsh098/microservice-deploy-gateway-svc)
4. **RabbitMQ deployment** [https://github.com/harsh098/microservice-deploy-rabbitmq](https://github.com/harsh098/microservice-deploy-rabbitmq)
5. **Converter Service** [https://github.com/harsh098/microservice-deploy-converter-service](https://github.com/harsh098/microservice-deploy-converter-service)
6. **Notification Service** [https://github.com/harsh098/microservice-deploy-notification-service](https://github.com/harsh098/microservice-deploy-notification-service)
------
### Setting up your Local kubernetes cluster
#### Part-I. Start Docker, mysqld, and mongod
Assuming you have `mysql` and `mongo` installed on local and `mongo` is configured to allow access without authentication.
1. Configure You `mysqld.service` and `mongod.service` to allow all hosts i.e. `0.0.0.0` (for all IPv4) or `::` (for all IPv6 abd IPv4)
`sudo systemctl start docker mysqld and mongod`
2. Edit `init.sql` as instructed in the file
3. run `init.sql`
#### Part-II. Setting Up minikube and conatiners
1. Run the following commands
```
minikube start
eval $(minikube -p minikube docker-env)
```
2. Clone the git repo
3. cd into the directory
Run the following command ```./builder.py .```
4. edit following `secret.yaml` files for your setup
1. `JWT_SECRET` in `auth_service/manifests/secret.yaml [here](https://github.com/harsh098/microservice-deploy/blob/main/auth_service/manifests/secret.yaml)
2. `GMAIL_ADDRESS` and `GMAIL_PASSWORD` in `notification_service/manifests/secret.yaml` [here](https://github.com/harsh098/microservice-deploy/blob/main/notification_service/manifests/secret.yaml)
5. Run `minikube ip`
#### Part-III. Edit your DNS Records
***Note:*** replace `192.168.49.2` with the **address** in the output of `minikube ip`
Add the following lines to `/etc/hosts` (in **Mac/Linux**) or `C:\Windows\System32\Drivers\etc\hosts` (in **Windows**)
```
192.168.49.2 kubernetes.docker.internal
192.168.49.2 vid2mp3.com
192.168.49.2 rabbitmq-manager.com
```
#### Part-IV. Start the deployments
Run The following commands
1. cd into project directory
```
kubectl create -f auth_service/manifests
kubectl create -f gateway/manifests
kubectl create -f rabbit/manifests
kubectl create -f converter_svc/manifests
kubectl create -f notification_service/manifests
```
2. **Mac and Windows Users need to run** `minikube tunnel` **in a separate terminal window**
## Running Demo
##### STEP-1 login via /login endpoint and get JWT

##### STEP-2 Upload video via /upload endpoint and validate using JWT

##### STEP-3 The video is processed and notification received on e-mail

##### STEP-4 Download the converted file using /download (validate using JWT)

##### Running Kubernetes cluster Objects
###### I. Pods
###### II. Ingresses
###### III. Deployments
###### IV. Persistent Volumes
###### V. Stateful Sets
