Giter Site home page Giter Site logo

rihemebh / delivery-microservice-devops Goto Github PK

View Code? Open in Web Editor NEW
17.0 1.0 4.0 2.15 MB

Microservice application developed with NestJs and deployed on Azure AKS

Kotlin 0.14% Swift 1.17% Objective-C 0.04% Dart 31.75% CMake 18.98% C++ 21.23% C 1.44% HTML 1.86% HCL 3.05% JavaScript 2.02% Dockerfile 0.79% TypeScript 15.27% Shell 2.24%
devops argocd helm kubernetes prometheus terraform azure

delivery-microservice-devops's Introduction

About

Microservice application developed with NestJs and deployed on kubernetes

Prerequisite and Tool

  • Nestjs
  • Flutter
  • Azure account
  • Kubernetes
  • Terraform
  • Helm
  • Prometheus
  • Grafana
  • ArgoCD
  • OpenTelemetry

Overview (DEV)

Koultime is a mobile application that helps find your best food and order it online.

Frontend:

  • Mobile application developed with flutter

Backend:

  • Microservice application developed with Nest.js

The reosons behind choosing the microservice architecture is:

  • The flexibility to add new services
  • The ability to scale the service of orders independtly whenever we have a lot of demand

Services :

  • Orders Microservice:

    • Create orders
    • Get list of orders
  • Product Microservice

    • Get list of products
    • Create new product
  • The microservices communicate with an api gateway

Architecture

Overview (OPS)

Deployment

  • The client could only communicate with the api gateway: we should expose a public IP

  • For the microservices we should allow only the traffic from the api gateway

  • The different apps are isolated in their namespaces (which we give the possibility of having multi env)

  • The connection to the database is made through the connection string (provided by mongodb atlas) and stored in a secret

  • I used config maps to store the name of the services that will be used by the api gateway to send requets to microservices

Workload health tracking

/health is the route responsible of returning the pod's health implemneted using terminus package.

livenessprobe is added to the deloyment definition in order to track the health based on the response of /health

Helm

I created helm charts with values file for every microservice.

Check the charts Here

I used the charts of prometheus and grafana for monitoring.

Automation

The provisioning of the cluster is made by the first stack of Terraform The provisioning of the helm release of argocd is made by the second stack of Terraform

The deployment is automated using argoCD

Network visualization of the api-gateway

Tree of the api-gateway

Tree of the order microservice

Monitoring

Metrics

  • The different metrics are set using prometheus:

    • cpu usage, memory usage, number of requests..
  • A bussiness metric is called orders is the one responsible for counting the number of orders requested

We can vizualize the diferent metrics using Grafana:

Logs

Used Nest.js logger to collect logs.

Test the project

    Make sure that you have  all the tools installed
  • Clone the project
  • Under the script folder you will find scripts
    • execute init_tf.bash
    • connect to the cluster
    • execute init_helm.bash

delivery-microservice-devops's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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.