Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
831a23d
Start
scheeles Jun 12, 2019
cb33616
Change course
scheeles Jun 12, 2019
ada06ca
change C2 - C3
scheeles Jun 12, 2019
f6e9c27
Update restapi
scheeles Jun 17, 2019
7bd155a
Update
scheeles Jun 17, 2019
6e5e9e3
refactor: Organize & divide code to micro-services
seifElislam Dec 15, 2019
8608a73
refactor: Delete unrelated files to each micro-service
seifElislam Dec 15, 2019
b03daad
refactor: Use jwt for required auth
seifElislam Dec 15, 2019
09d9eb9
feat: Add Dockerfiles
seifElislam Dec 15, 2019
6b9fd15
Add nginx docker & config file
seifElislam Dec 21, 2019
c1350b8
Add docker-compose files
seifElislam Dec 21, 2019
9d6188d
Update docker file & use node12 instead of node:apline
seifElislam Dec 21, 2019
cb3b2ca
Add url to config vars
seifElislam Dec 21, 2019
1005a51
Import config vars
seifElislam Dec 21, 2019
2b3c840
Use config url instead of hardcoded url
seifElislam Dec 21, 2019
05f8daa
Update .gitignore file
seifElislam Dec 24, 2019
367df05
Update .gitignore file
seifElislam Dec 24, 2019
59655ca
Add travis CI pipeline
seifElislam Dec 24, 2019
c62bb76
Add k8s deployment & service yml files
seifElislam Dec 24, 2019
5e7439c
Update travis pipeline to push images to dockerhub
seifElislam Dec 24, 2019
a16f13e
Add k8s deployment & services for user,feed,nginx and frontend
seifElislam Dec 24, 2019
9186819
Fix passing username when login to dockerhub
seifElislam Dec 24, 2019
043d685
Update k8s deployment & services files
seifElislam Dec 24, 2019
b2c4ffe
Allow access cross origin
seifElislam Dec 24, 2019
9e3b50a
Allow CROS in feed/user servers
seifElislam Dec 25, 2019
350fc1c
Allow cros for localhost only
seifElislam Dec 25, 2019
df6bc5d
Update deployemt for feed/user
seifElislam Dec 25, 2019
6d82119
Use cors pkg
seifElislam Dec 25, 2019
5b66b54
Update nginx configration
seifElislam Dec 25, 2019
3216a29
Update nginx configuratation
seifElislam Dec 25, 2019
b794529
Restore old nginx configuration
seifElislam Dec 25, 2019
494dbfc
Expose container port in depolyment files
seifElislam Dec 25, 2019
100f50e
Restore old microservices CROS config
seifElislam Dec 25, 2019
f70329b
Remove all CORS from nginx configuration
seifElislam Dec 25, 2019
c5033e1
Update replica sets for feed/user
seifElislam Dec 25, 2019
9b426ac
Add submission screenshots
seifElislam Dec 25, 2019
2b27c18
Update README file
seifElislam Dec 25, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.secrets.txt
27 changes: 27 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
language: minimal

services: docker

env:
- DOCKER_COMPOSE_VERSION=1.23.2

before_install:
- docker -v && docker-compose -v
- sudo rm /usr/local/bin/docker-compose
- curl -L https://github.com/docker/compose/releases/download/${DOCKER_COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > docker-compose
- chmod +x docker-compose
- sudo mv docker-compose /usr/local/bin
- curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
- chmod +x ./kubectl
- sudo mv ./kubectl /usr/local/bin/kubectl
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin



install:
- docker-compose -f docker-compose-build.yaml build --parallel
- docker-compose -f docker-compose-build.yaml push

branches:
only:
- master
52 changes: 50 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,50 @@
# cloud-developer
content for Udacity's cloud developer nanodegree
# Udacity Project - Refactor Udagram Into Microservices

Refactoring [udagram initial monolitic](https://github.com/udacity/cloud-developer/tree/master/course-02/exercises/udacity-c2-restapi) application into separate microservices as follows:


- Divide the application into smaller services and extend it with additional service and automatic continuous integration and continuous delivery.
- Containerize the application, create the Kubernetes resource and deploy it to a Kubernetes cluster.
- Extend the application with deployments and be able to do rolling-updates and rollbacks.

## Usage
### Installation
- Prerequisite: It is best to have Ubuntu 18.04, Docker 18.09, KubeOne v0.9.0, Terraform 0.12.8 installed before starting the project.
- Once the repository has been downloaded, you will need to first install all dependencies by running `npm i`. You will need to repeat this for all `Frontend`, `Restapi-Feed` and `Restapi-user` folders.
- Also, ensure all environment variables are set up in your `~/.profile`.
- For Docker:
- First, install Docker in your system.
- Create the docker images for the `udagram-frontend`, `udagram-restapi-feed`, and `udagram-restapi-user` folders. E.g. the command is `sudo docker build -t [name]/udagram-frontend .`
- For Reverseproxy, you need to create another docker image in the `nginx` folder using the same command.
- Push the docker images to DockerHub using `sudo docker push [name]/udagram-frontend`.
- Once all images are pushed, you can build using `sudo -E docker-compose up` whilst in the docker deployment folder.
- Go to Localhost:8080 to test.
- Docker deployment complete.
- For Kubernetes:
- Install Kubernetes using the Kubeone instructions given here: `https://github.com/kubermatic/kubeone/blob/master/docs/quickstart-aws.md`
- Follow the setup videos closely, and export the KubeConfig.
- Check for the proper setup using `kubectl get pods`.
- Set up the secret keys and configmaps for the project. These are the .yaml files in the k8s folder.
- Make sure the .yaml files are also pointing to the right Docker images which you set up previously.
- Use `kubectl apply -f [file-name]` on the secret key, config map files.
- Use `kubectl apply -f [file-name]' again for the remaining .yaml files. If all is set up correctly, you will see all pods running. Test using `kubectl get rs`, `kubectl get deployment`, and `kubectl get pods`.
- Forward the deployment port to Localhost:8080 using `kubectl port-forward [name]/reverseproxy-[id] 8080:8080`.
- Go to Localhost:8080 to test.
- Kubernetes deployment completed.
- For Travis:
- Ensure your Github account is linked to Travis. This is done via signing up for a Travis account, then from within linking the two together.
- Push your folders to Github repository. No need for node_modules nor secrets to be included in the repository.
- Ensure the .travis.yml file is in the root folder of the Github repo.
- Go to Travis, then search for the repository, and then set up new build.
- Travis deployment completed.

## Dependencies

There are dependencies on having an S3 bucket provisioned and an RDS postgres instance provisioned if you want to run this locally on your machine

### Images for evidence
- Attached are the following images which demonstrate the functionality of the project:
- Running application;
- DockerHub images;
- Kubernetes running pods; and
- Travis deployment completed.
37 changes: 0 additions & 37 deletions course-02/exercises/udacity-c2-basic-server/.gitignore

This file was deleted.

62 changes: 0 additions & 62 deletions course-02/exercises/udacity-c2-basic-server/README.md

This file was deleted.

38 changes: 0 additions & 38 deletions course-02/exercises/udacity-c2-basic-server/package.json

This file was deleted.

14 changes: 0 additions & 14 deletions course-02/exercises/udacity-c2-basic-server/src/cars.ts

This file was deleted.

147 changes: 0 additions & 147 deletions course-02/exercises/udacity-c2-basic-server/src/server.solution.ts

This file was deleted.

Loading