A photo sharing app built as a microservice application
This project is to refactor "Udagram - photo sharing" Monolith application. The aim is to divide the application into smaller microservices. Each microservice needs to run in a separate Docker container. The docker containers needs managed by using the Kubernetes cluster. It is aimed at demonstrating independently scaling-up an application, release, and deploying the project using Kubernetes, and TravisCI.
The project has the following services(4):
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
Install or set up an account on the platforms below to successfully install the project
Necessary but not required 8. Postman 9. Postbird
export PATH=$PATH:/usr/local/mysql/bin/
export POSTGRESS_USERNAME=myusername;
export POSTGRESS_PASSWORD=mypassword;
export POSTGRESS_DATABASE=postgres;
export POSTGRESS_HOST=udagramdemo.abc4def.us-east-2.rds.amazonaws.com;
export AWS_REGION=us-east-2;
export AWS_PROFILE=default;
export AWS_MEDIA_BUCKET=udagramdemo;
export JWT_SECRET=helloworld;
After adding the env variables, run
source ~/.profile
docker build -t <your_dockerhub_username_lowercase>/<image_name> .
docker push <your_dockerhub_username_lowercase>/<image_name>
docker run --rm --publish 8080:8080 -v $HOME/.aws:/root/.aws --env POSTGRESS_HOST=$POSTGRESS_HOST --env POSTGRESS_USERNAME=$POSTGRESS_USERNAME --env POSTGRESS_PASSWORD=$POSTGRESS_PASSWORD --env POSTGRESS_DB=$POSTGRESS_DB --env AWS_REGION=$AWS_REGION --env AWS_PROFILE=$AWS_PROFILE --env AWS_BUCKET=$AWS_BUCKET --env JWT_SECRET=$JWT_SECRET --name feed <your_dockerhub_username_lowercase>/udacity-restapi-feed
docker container ls
docker container kill <container_name>
docker container prune
docker-compose -f docker-compose-build.yaml build --parallel
inorder to build the images for the services
docker-compose up
and verify if the application is working successfully by navigating to:
http://localhost:8100/
Stop the containers with:
docker-compose down
Install Kubernetes on AWS cluster using this resource
Configure application by running the following
```
kubectl apply -f env-secret.yaml
kubectl apply -f env-secret.yaml
```
Create services with
```
kubectl apply -f <name_of_file>
```
Using port forwarding, run the application
```
k port-forward service/reverseproxy 8080:8080
```
```
k port-forward service/frontend 8100:8100
```