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:
- The Simple Frontend A basic Ionic client web application which consumes the RestAPI Backend.
- The RestAPI Feed Backend, a Node-Express feed microservice.
- The RestAPI User Backend, a Node-Express user microservice.
- Docker hub images found here
- Screenshots are documented and found in the screenshots directory
As follows:
cd udacity-c3-deployment/docker
docker-compose -f docker-compose-build.yaml build --paralellTo push images:
docker-compose -f docker-compose-build.yaml pushEnsure you are logged into docker hub first.
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.yamlSetting KUBECONFIG to the current path ensures we pick up this config:
export KUBECONFIG=$(pwd)/udagram-config.yamlThe cluster can be destroyed by:
cd /udacity-c3-deployment/eks
eksctl delete cluster -f udagram-config.yamlNext 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.yamlCheck the deployment:
kubectl get pod
kubectl get deploymentTo test the deployment locally:
kubectl port-forward service/frontend 8100:8100
kubectl port-forward service/reverseproxy 8080:8080Open localhost:8100 in a browser to check the docker 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 -dOpen localhost:8100 in a browser to check the docker deployment.
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
Implemeted in the /udacity-c3-deployment/k8s deployment files.