This is the Udacity project to split the udagram application in microservice and deploy it in Kubernetes cluster in AWS.
Install the below items:
After decomposing the services, please run the following command to make the docker images and push the images to registry (docker hub).
Check the images in docker hub. We should see something like below:
In case you want to use my images, you can find those here:
Now to spin up the cluster run the following command:
eksctl create cluster --name MyClusterName --version 1.14 --nodegroup-name standard-workers --node-type t3.medium --nodes 3 --nodes-min 1 --nodes-max 4 --node-ami auto
Change the type of the services of Frontend and Reverseproxy to Loadbalancer in the yaml definition of the services.
Run below command to spin the application:
If everything is alright, then run the following command to see all the resources:
Above command should bring the resoucres like below
As the frontend and reverseproxy services has been added as LoadBalancer, you will see that AWS has attached public interface in the external load balancer field. Other two services are running as the ClusterIP type.
Now you need to copy the reverse proxy EXTERNAL_IP and change the configuration of the front end prod & frond end to use this IP as backend instead of localhost. Note that, to access the feed and user service from frontend service from browser, you need to add CORS header in the nginx.conf file. Details changes are inside the repo. Now rebuild the docker image for frontend service and reverse proxy following step 01. Then update the kubernetes deployments applying kubectl apply command similar to step 03.
To check whether the application is accessible, please copy the EXTERNAL-IP of frontend service and open it in browser with port 8100. This should bring the frontend like below:
Connect your Github Repo with TravisCI. Make the changes mentioned in the .travis.yml file. Go to settings of the project and add all the required environment variables mentioned in the configuration files of the backend services. Then make any change in the code base and push it to Repo. This should automatically trigger the build and after successful build you should see something like below:
When you have collected all your artifacts required to submit the assignment, do not forget to clear the cluster to avoid additional charging. Please use below command to clear this.
This commit is for test