Build and deploy a professional REST API to Kubernetes with Gimlet π
- Our goal π―
- How to run the API locally? π
- How to deploy the API to Kubernetes with Gimlet? π
- How to monitor our API with Elasticsearch and Kibana? π
- See it in action π¬
- Wanna learn more real-world ML? π§
Letβs build and deploy a production-ready REST API that can serve data on historical taxi rides in NYC.
The original data is stored in one-month parquet files on this website, and our goal is to make it easily accessible to the WORLD through a REST API.
Git clone this repository, cd into the root directory of the project and then run the following commands using make.
-
Install Python Poetry (if necessary) and create an isolated virtual environmnet for development purposes.
$ make install
-
Test, build and run the dockerized REST API with
$ make all
-
Check the API is up and running locally, and that you can connect to it
$ make health-check-local
-
Send a sample request to the local API
$ make sample-request-local
Good job. The API is up and running locally. However, until you donβt deploy it to a production environment, and make it accessible to
- your clients ππ»ββοΈ
- your colleagues π¨π»βπΌ
- or the whole world π
your real-world impact is ZERO.
Let me show you how to deploy this API to a production Kubernetes cluster.
What is Kubernetes? βΈπ¦
Kubernetes is an open-source container orchestration platform that automates the deployment, scaling, and management of your Dockerized apps
It is currently the most widely used container orchestration platform in the world, and it has become the de facto standard due to its robust features, large community support, and backing from major tech companies.
Gimlet is a tool that helps you quickly deploy your apps to ANY Kubernetes cluster.
- You can do it entirely from the Gimlet UI, as explained in this article.
or
- You can adjust the gimlet manifest in this repository, to automatically deploy your code changes to the main branch.
These are the steps:
- Spin up Elasticsearch and Kibana with the docker compose
- Add middleware to FastAPI app
- Build a dashboard with Kibana
ππ½ Click here to try the API
Join more than 19k builders to the Real-World ML Newsletter. Every Saturday morning.