Skip to content

Latest commit

 

History

History
59 lines (46 loc) · 2.16 KB

File metadata and controls

59 lines (46 loc) · 2.16 KB

A mini microservice app

I use Docker and Kubernetes to create a microservice app. The microservice is based on Event-driven architecture pattern.
Event-driven architecture pattern is a distributed asynchronous architecture pattern to create highly scalable reactive applications. The pattern suits for every level application stack from small to complex ones. The main idea is delivering and processing events asynchronously.

Overview

- Main functions

  • Post Service
  • Comment Service
  • Query Service
  • Moderation Service
  • Event-bus Service solves the problem of how microservices communicate with each other.

- Tech Stack

  • Front-end: React
  • Back-end: Node.js
  • Deployment: Docker, Kubernates(Load Balancer, Ingress Controller), Skaffold

Implementation

- Docker and Kubernates

  • Why Docker? Do not need to care about the running environment and precise knowledge of how to start it(npm start).
  • Why Kubernates? Kubernates help us better manage container which Docker creates.

- Load Balancer && Ingress Controller

  • Load Balancer
    Tells Kubernates to reach out to its provider and provision a load balancer. Gets traffic into a single pod.
  • Ingress Controller
    A pod with a set of routing rules to distribute traffic to other services

- Skaffold

Automates many tasks in a Kubernetes dev environment. Skaffold handles the workflow for building, pushing and deploying your application, allowing me to focus on what matters most: writing code.

Local Usage

Install dependencies on each service folder

npm install

Create Docker Images + Push them to docker hub

docker build -t dwightu/`servicename` .
docker push dwightu/`servicename`

Run Kubernates

kubectl apply -f infra/k8s