Simple Kubernetes-based app that contains 3 services:
- Flask (Python) microservice (management of applications' logs)
- Sinatra (Ruby) microservice (OAuth server - user registration and login)
- MongoDB
The purpose of this app is to log history about web apps requests.
By accessing Sinatra microservice:
- Create user via
POST /usersendpoint by providingusernameandpasswordas JSON - Login via
POST /loginendpoint 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:
- Take valid jwt token from previous step
- Create application via
POST /applicationsby providingnamefor the app as JSON - Check list of your current apps via
GET /applications - Create log for particular app via
POST /logs/<application_id>by providingip_addressandrequest(nested json) as JSON - Check list of the logs for this application
GET /logs/<application_id> - See flask app routes for some more routes
- Containerized microservices (flask, sinatra)
- Deployed to Kubernetes cluster (see folder with kubernetes components)
- Communication between microservices to resolve user's authentication
- MongoDB storage
- JWT authentication
- Nginx proxy-server via Kubernetes Ingress. See its config for the project
- To run in development follow instructions on how to build related docker images written in flask folder and sinatra folder)
- 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