Git Product home page Git Product logo

kubernetes-microservices's Introduction

Microservices in kubernetes

Simple Kubernetes-based app that contains 3 services:

  1. Flask (Python) microservice (management of applications' logs)
  2. Sinatra (Ruby) microservice (OAuth server - user registration and login)
  3. MongoDB

The purpose of this app is to log history about web apps requests.

Usage flow

By accessing Sinatra microservice:

  1. Create user via POST /users endpoint by providing username and password as JSON
  2. Login via POST /login endpoint by providing the same credentials (jwt token)

After that you can use Flask microservice (Warning! JWT authentication required). Flask microservice will query Sinatra auth microservice to check validity of token and resolve ID of the user via GET /check_login endpoint:

  1. Take valid jwt token from previous step
  2. Create application via POST /applications by providing name for the app as JSON
  3. Check list of your current apps via GET /applications
  4. Create log for particular app via POST /logs/<application_id> by providing ip_address and request (nested json) as JSON
  5. Check list of the logs for this application GET /logs/<application_id>
  6. See flask app routes for some more routes

Features

  1. Containerized microservices (flask, sinatra)
  2. Deployed to Kubernetes cluster (see folder with kubernetes components)
  3. Communication between microservices to resolve user's authentication
  4. MongoDB storage
  5. JWT authentication
  6. Nginx proxy-server via Kubernetes Ingress. See its config for the project

How to run

  1. To run in development follow instructions on how to build related docker images written in flask folder and sinatra folder)
  2. In production follow Kubernetes official guide to deploy a cluster. Deploy all Kubernetes components from Kubernetes config folder for example via kubectl apply -f <file>.yml

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.