Skip to content

chedburgh/udacity-udagram-microservice

Repository files navigation

Udacity Udagram Microservice

Cloud microservice project deployed on kubernetes.

Udagram is a simple cloud application developed alongside the Udacity Cloud Engineering Nanodegree. It 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 three parts:

  1. The Simple Frontend A basic Ionic client web application which consumes the RestAPI Backend.
  2. The RestAPI Feed Backend, a Node-Express feed microservice.
  3. The RestAPI User Backend, a Node-Express user microservice.

Links

  • Docker hub images found here
  • Screenshots are documented and found in the screenshots directory

Docker Build Steps

As follows:

cd udacity-c3-deployment/docker
docker-compose -f docker-compose-build.yaml build --paralell

To push images:

docker-compose -f docker-compose-build.yaml push

Ensure you are logged into docker hub first.

Deployment

Cloud Deployment

Ensure the following requirements are met:

  • aws cli installed
  • aws eksctl installed
  • kubectl installed

Create the aws cluster and save the config for later:

cd /udacity-c3-deployment/eks
eksctl create cluster -f udagram-cluster.yaml --kubeconfig=./udagram-config.yaml

Setting KUBECONFIG to the current path ensures we pick up this config:

export KUBECONFIG=$(pwd)/udagram-config.yaml

The cluster can be destroyed by:

cd /udacity-c3-deployment/eks
eksctl delete cluster -f udagram-config.yaml

Next the services can be deployed as follows:

cd /udacity-c3-deployment/k8s
kubectl apply -f aws-secret.yaml
kubectl apply -f env-secret.yaml 
kubectl apply -f env-configmap.yaml 
kubectl apply -f backend-feed-deployment.yaml 
kubectl apply -f backend-feed-service.yaml
kubectl apply -f backend-user-deployment.yaml 
kubectl apply -f backend-user-service.yaml
kubectl apply -f frontend-deployment.yaml 
kubectl apply -f frontend-service.yaml
kubectl apply -f reverseproxy-deployment.yaml 
kubectl apply -f reverseproxy-service.yaml

Check the deployment:

kubectl get pod
kubectl get deployment

To test the deployment locally:

kubectl port-forward service/frontend 8100:8100
kubectl port-forward service/reverseproxy 8080:8080

Open localhost:8100 in a browser to check the docker deployment.

Local Deployment

The project can be deployed and tested locally using the docker-compose file under /udacity-c3-deployment/docker as follows:

Set the variables in the /udacity-c3-deployment/docker/.env file. These are:

POSTGRESS_USERNAME=
POSTGRESS_PASSWORD=
POSTGRESS_DB=
POSTGRESS_HOST=
AWS_REGION=
AWS_PROFILE=
AWS_BUCKET=
JWT_SECRET=

Now run the system:

cd /udacity-c3-deployment/docker/
docker-compose up -d

Open localhost:8100 in a browser to check the docker deployment.

Travis CI/CD

Travis has been configured to carry out the following CI/CD operations:

  • Build the docker images
  • Push the docker images to Docker Hub
  • Automatically deploy the new images to AWS EKS

Rolling Updates

Implemeted in the /udacity-c3-deployment/k8s deployment files.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published