Welcome to the FastAPI & Kubernetes Tutorial Series with PyCharm & AWS EKS.
Before starting up this project, make sure you have an AWS account and PyCharm installed in your machine.
- In this tutorial we will be using PyCharm Professional.
-
AWS Command Line Interface - The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services.
-
eksctl - The official CLI for Amazon EKS
-
Docker - Docker helps developers bring their ideas to life by conquering the complexity of app development.
-
Kubernetes - also known as K8s, is an open-source system for automating deployment, scaling, and management of containerized applications.
-
Helm - The package manager for Kubernetes. Helm helps you manage Kubernetes applications — Helm Charts help you define, install, and upgrade even the most complex Kubernetes application.
-
PostgreSQL - The World's Most Advanced Open Source Relational Database
-
Redis - open source (BSD licensed), in-memory data structure store, used as a database, cache, and message broker
-
NICE DCV (Optional) - Deliver high-performance remote desktop and application streaming. If you are interested to run your workload directly in AWS.
- Make sure your system is up-to-date.
- Run the below command to install python system dependencies along-with postgres driver.
$ sudo apt-get install libpq-dev python-dev libssl-dev
- Installing Python Packages
$ pip install -r requirements.txt
- Running Uvicorn Server
$ uvicorn main:app --reload
Make sure to update the environment variables in ecommerce/config.py, before starting up the project.
Make sure before starting up Celery, redis is up and running.
Command to start celery worker :
$ celery -A main.celery worker -l info
or with execution pool
$ celery -A main.celery worker -l info --pool=prefork
Reference Materials:
- Celery Execution Pools: What is it all about?
- A complete guide to production-ready Celery configuration
- Eliminating Task Processing Outages by Replacing RabbitMQ with Apache Kafka Without Downtime
Before proceeding make sure you have created a test database in Postgres.
If you are interested to know more about AWS with Python, then you can follow the below links.