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.
You'll need to install docker https://docs.docker.com/install/. Open a new terminal within the project directory and run:
- Switch the folder:
cd udacity-c3-deployment/docker
- Build the images:
docker-compose -f docker-compose-build.yaml build --parallel
- Push the images:
docker-compose -f docker-compose-build.yaml push
- Run the container:
docker-compose up
- Go to your terraform/aws folder
- See what commands will be made to create infrastructure:
terraform plan
- Provision the infrastructure:
terraform apply
- Say
yes
to confirm provisioning the infrastructure
- Say
- Create Terraform state file to be parsed by kubeone:
terraform output -json > tf.json
- Install Kubernetes using configuration output from Terraform:
kubeone install config.yaml --tfjson tf.json
- Setup KUEBCONFIG variable that will be used by kubectl commands, run this command in any terminal window that the kubectl command will be run in
export KUBECONFIG=$PWD/udagrambox
You will need to install the kubectl command. Open a new terminal within the project directory and run:
- Generate encrypted values for aws credentials, Database User Name, and Database Password using bcrypt and put the values into aws-secret.yaml and env-secret.yaml files
- Load secret files:
kubectl apply -f aws-secret.yaml
kubectl apply -f env-secret.yaml
- Load config map:
kubectl apply -f env-configmap.yaml
- Apply Deployments:
kubectl apply -f backend-feed-deployment.yaml
kubectl apply -f frontend-deployment.yaml
kubectl apply -f backend-user-deployment.yaml
- Apply Services:
kubectl apply -f backend-feed-service.yaml
kubectl apply -f backend-user-service.yaml
kubectl apply -f frontend-service.yaml
- Deploy reverse proxy
kubectl apply -f reverseproxy-deployment.yaml
kubectl apply -f reverseproxy-service.yaml
- Perform port forwarding
kubectl port-forward service/frontend 8100:8100
kubectl port-forward service/reverseproxy 8080:8080
- Travis CI is setup to monitor for updates to master branch