GithubHelp home page GithubHelp logo

cchamangwana / monolith-to-microservice Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 7.56 MB

Udacity Class Project - Refactor a Monolith to Microservices & deploy using Kubernetes

License: Other

Dockerfile 1.50% TypeScript 80.76% JavaScript 4.40% HTML 7.75% SCSS 5.36% Shell 0.22%
cloud-computing k8s udacity

monolith-to-microservice's Introduction

Monolith to Microservices

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.

Prerequisites

Docker

Instructions for installing Docker can be found here.

Kubernetes

Kubernetes Cluster

  • Minikube: Instructions for installing Minikube can be found here
  • KubeOne: Instructions for installing KubeOne can be found here (Linux and macOS only)
  • Docker Desktop: For macOS and Windows it is recommended to install Kubernetes by enabling it in Docker Desktop

Kubernetes CLI

It is recommended to use kubectl for managing the Kubernetes cluster. Intructions for installing kubectl can be found here.

Travis CI

Instructions for installing Travis CI with a GitHub repository can be found here.

Dependencies

  • Amazon Web Services S3 - Bucket for image storage
  • Amazon Web Services RDS - Postgres database instance
  • Amazon Web Services IAM account (optional)

Getting Started

Settings

The following settings are required by the application:

  • AWS_BUCKET - S3 bucket name
  • AWS_REGION - AWS region
  • AWS_PROFILE - AWS profile
  • JWT_SECRET - JWT token secret
  • POSTGRESS_DB - Postgres database name
  • POSTGRESS_HOST - URL of Postgres database instance
  • POSTGRESS_PASSWORD - Database password
  • POSTGRESS_USERNAME - Database username
  • URL - Application URL

Docker Environment

Open a new terminal within the project directory and run:

  1. Build the images: docker-compose -f docker-compose-build.yaml build --parallel
  2. Push the images: docker-compose -f docker-compose-build.yaml push
  3. Start the containers: docker-compose up

Kubernetes Environment

  1. Setup secret keys and configmaps (aws-secret, env-secret, env-configmap)
  2. Apply secret keys and configmap: kubectl apply -f aws-secret.yaml -f env-secret.yaml -f env-configmap.yaml
  3. Apply deployments: kubectl apply -f backend-feed-deployment.yaml -f backend-user-deployment.yaml -f frontend-deployment.yaml -f reverseproxy-deployment.yaml
  4. Apply services: kubectl apply -f backend-feed-service.yaml -f backend-user-service.yaml -f frontend-service.yaml -f reverseproxy-Service.yaml

Travis CI

  1. Setup environment variables for Docker Hub credentials
  2. Setup application environment variables (as above)
  3. Push latest changes to the repository
  4. Build application with Travis CI

Acknowledgements

This project was bootstrapped with https://github.com/scheeles/cloud-developer/tree/06-ci/course-03/exercises.

monolith-to-microservice's People

Contributors

cchamangwana avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.