CLOUD DEVELOPER (nd9990) - PROJECT 3 - Udagram V2 - microservices at scale! Your Own Instagram on AWS!
Udacity NANODEGREE Cloud Developer - My Root repository
Udagram allows users to register and log into a web client, post photos to the feed, and process photos using an image filtering microservice.
The project is split into four parts:
- The Frontend, an Ionic client web application which consumes the RestAPI feed and user.
- The RestAPI Feed Backend, a Node-Express feed microservice.
- The RestAPI User Backend, a Node-Express user microservice.
- The reverse proxy server, a NGINX proxy server.
You need to install:
Test that your installation is successful with the following commands:
aws --version
docker --version
docker-compose version --short
eksctl version
kubectl version --short --client
Open your bash profile to store your application variables at OS level to use them within and across applications:
open ~/.profile
Copy and Paste the bash scripts bellow with your values:
export DB_USERNAME=your postgress username;
export DB_PASSWORD=your postgress password;
export DB_NAME=your postgress database;
export DB_HOST=your postgress host;
export AWS_REGION=your aws region;
export AWS_PROFILE=your aws profile;
export AWS_MEDIA_BUCKET=your aws bucket name;
export JWT_SECRET=your jwt secret;
export ACCESS_CONTROL_ALLOW_ORIGIN=url of the frontend;
Source your .profile to execute your bash scripts automatically whenever a new interactive shell is started:
source ~/.profile
To run the docker images, 2 options:
- 1a) Get Docker images from Docker Hub
- 1b) Build the Docker images
The project's images are available at Docker Hub :
- kendyjm/udacity-restapi-feed
- kendyjm/udacity-restapi-user
- kendyjm/udacity-frontend
- kendyjm/udacity-nginx-reverseproxy
Just push these images executing this script:
docker pull kendyjm/udacity-restapi-feed:latest
docker pull kendyjm/udacity-restapi-user:latest
docker pull kendyjm/udacity-nginx-reverseproxy:latest
docker pull kendyjm/udacity-frontend:latest
Build the docker images by following the documentation in udacity-c3-deployment/docker
Check images available : docker images
Run your docker containers: docker-compose up
Browse the frontend application : http://localhost:8100/
To exit run control + C
Create your cluster with eksctl
by following documentation in udacity-c3-deployment/eks
Your cluster is created and visible in the AWS Console/EKS:
Setup the ubernetes environment by following the documentation in udacity-c3-deployment/k8s
kubectl get all
kubectl logs <podId>
Use Port Forwarding to the Frontend and Reverse Proxy services: The port forwarding must be done in Separate terminals, to run both services at the same time.
kubectl port-forward service/frontend 8100:8100
kubectl port-forward service/reverseproxy 8080:8080
Browse the frontend application : http://localhost:8100/
- Sign up for Travis and connect your Github application repository to TravisCL.
- Have a look to the config file that will be read by Travis, at the root of the repository. It needs some environment variables.
- Add your environment variables to the project repository in Travis by selecting the setting option.
- Commit and Push your changes trigger a Travis build.
- Check the build status page to see if your build passes or fails according to the return status of the build command by visiting TravisCL and selecting your repository.