Deploying Fastapi And Postgresql Microservices To Eks
This lab shows you how to deploy the microservices of the python-fastapi-demo-docker project onto your Amazon EKS cluster—either your AWS Fargate or managed node groups-based cluster. To gain a deeper understanding of the Kubernetes resources in these manifests, refer to Deploying FastAPI and PostgreSQL Kubernetes resources to Amazon EKS. Navigate to the root directory of the python-fastapi-demo-docker project where your environment variables are sourced: Run the following command from the python-fastapi-demo-docker project directory to create the ConfigMap: The expected output should look like this: To confirm that your Kubernetes Configmap has been successfully created, you can use the kubectl get configmap command.
This command lists all ConfigMaps that exist in the specified namespace: Production-ready microservice architecture using FastAPI, Kafka (Redpanda), PostgreSQL, Prometheus, Grafana, and Jaeger, containerized with Docker Compose. 📄 Full guide: Observability Metrics Architecture ✅ Verification checklist: Observability Validation Guide Access Grafana: http://localhost:3000 Login: admin / admin OTEL config: otel/otel-collector-config.yaml Simulates concurrent order submissions using Faker + aiohttp
This lab is designed to equip you with the necessary skills for efficient deployment and management of microservices, specifically those belonging to the python-fastapi-demo-docker project, within a Kubernetes environment. Through the steps outlined in this lab, you will learn how to configure, deploy, and manage your microservices using Minikube and Amazon ECR. For a comprehensive understanding of the different Kubernetes resources being created, refer to Introduction to Managing Multiple Services with Kubernetes. Navigate to the root directory of the python-fastapi-demo-docker project where your environment variables are sourced: The 'postgres-db.yaml' manifest also consists of three primary Kubernetes resources: a StatefulSet, a Service, and a PersistentVolumeClaim. Take note that the Kubernetes service name of 'db' must match the server name 'db' in postgresql URL, which is set in file .env with variable DOCKER_DATABASE_URL=postgresql://bookdbadmin:dbpassword@db:5432/bookstore.
From the 'python-fastapi-demo-docker' project directory, apply the Kubernetes configuration: Modern cloud applications need scalability, observability, and automation. Manually deploying infrastructure is outdated; instead, we use Infrastructure as Code (IaC) for reproducibility and monitoring tools to keep track of application health. In this blog, we’ll build and deploy a FastAPI microservice on Amazon EKS (Elastic Kubernetes Service) using Terraform, while integrating Datadog APM (Application Performance Monitoring) for real-time tracing and insights. Terraform provisions an EKS cluster and networking infrastructure. The FastAPI application is containerized with Docker and deployed to EKS.
Datadog APM is integrated to collect real-time traces and metrics. Observability is improved with Datadog dashboards, metrics, and alerts. Building the Infrastructure with Terraform 1️⃣ Provisioning the VPC The VPC module creates the necessary networking resources 2️⃣ Deploying the EKS Cluster We use the EKS module to create a Kubernetes cluster: I've previously detailed deploying microservices on Azure AKS. In this guide, I expand on those insights, sharing my learnings on deploying FastAPI microservices on AWS EKS using Terraform to help others navigate the process smoothly.
In this project, I configured an AWS Kubernetes cluster with two nodes using a "t2.small" instance type via Terraform in the region us-west-2 (Oregon). This setup hosts a simple bookstore application developed with a microservices architecture. Key features include distinct services for managing books and client data, coordinated by Kubernetes. The system uses an API Gateway to facilitate service access and customize responses, including personalized messages and book discount information. efs_mount_targets.tf , eks_cluster.tf , eks_node_group.tf , iam_role.tf , internetgw.tf , provider.tf , rout.tf , sg.tf , subnet.tf , vpc.tf , efs-csi-driver-trust-policy.json As you can see, there is quite more complexity regarding configurations to deploy a simple K8s cluster into aws than into azure.
Mainly configuring role permissions, access policies and network security. Set at least the following permission policies: This project demonstrates microservices communication using FastAPI. It consists of three services that are built into Docker images and deployed to AWS EKS automatically. The infrastructure, including the EKS cluster and all required components, is provisioned using Terraform. Before deploying, update the following files:
After making these changes, push the modified code to your repository. GitHub Actions will automatically: Note: Homebrew is required for macOS. Modify the script if you are using Windows. This will configure your local environment and AWS credentials. This chapter shows you how to deploy the Kubernetes resources for our FastAPI application and PostgreSQL database within an Amazon EKS cluster.
This guide provides an overview of the resources to deploy the FastAPI application and PostgreSQL database within our Amazon EKS cluster. The deploy-app-python.yaml manifest file is used for the deployment of the FastAPI application and consists of three primary resources: The deploy-db-python.yaml file is used for the deployment of the PostgreSQL database and consists of four primary resources:
People Also Search
- Deploying FastAPI and PostgreSQL Microservices to EKS
- AWS EKS Deployment for FastAPI and Next.js Microservices (Part 3)
- moosasharieff/fastapi-kafka-eks-stack - GitHub
- Deploying FastAPI and PostgreSQL Microservices to Kubernetes using ...
- Using IaC (Terraform) to Deploy a FastAPI Microservice on EKS with for ...
- Deploying FastAPI Microservices on AWS Elastic Kubernetes Service (EKS ...
- Deploying Microservices on AWS EKS: Step-by-Step Guide
- Deploying FastAPI Microservices on AWS EKS with Terraform:
- GitHub - andyg2025/fastApi_demo_EKS
- About FastAPI and PostgreSQL Kubernetes resources
This Lab Shows You How To Deploy The Microservices Of
This lab shows you how to deploy the microservices of the python-fastapi-demo-docker project onto your Amazon EKS cluster—either your AWS Fargate or managed node groups-based cluster. To gain a deeper understanding of the Kubernetes resources in these manifests, refer to Deploying FastAPI and PostgreSQL Kubernetes resources to Amazon EKS. Navigate to the root directory of the python-fastapi-demo-d...
This Command Lists All ConfigMaps That Exist In The Specified
This command lists all ConfigMaps that exist in the specified namespace: Production-ready microservice architecture using FastAPI, Kafka (Redpanda), PostgreSQL, Prometheus, Grafana, and Jaeger, containerized with Docker Compose. 📄 Full guide: Observability Metrics Architecture ✅ Verification checklist: Observability Validation Guide Access Grafana: http://localhost:3000 Login: admin / admin OTEL ...
This Lab Is Designed To Equip You With The Necessary
This lab is designed to equip you with the necessary skills for efficient deployment and management of microservices, specifically those belonging to the python-fastapi-demo-docker project, within a Kubernetes environment. Through the steps outlined in this lab, you will learn how to configure, deploy, and manage your microservices using Minikube and Amazon ECR. For a comprehensive understanding o...
From The 'python-fastapi-demo-docker' Project Directory, Apply The Kubernetes Configuration: Modern
From the 'python-fastapi-demo-docker' project directory, apply the Kubernetes configuration: Modern cloud applications need scalability, observability, and automation. Manually deploying infrastructure is outdated; instead, we use Infrastructure as Code (IaC) for reproducibility and monitoring tools to keep track of application health. In this blog, we’ll build and deploy a FastAPI microservice on...
Datadog APM Is Integrated To Collect Real-time Traces And Metrics.
Datadog APM is integrated to collect real-time traces and metrics. Observability is improved with Datadog dashboards, metrics, and alerts. Building the Infrastructure with Terraform 1️⃣ Provisioning the VPC The VPC module creates the necessary networking resources 2️⃣ Deploying the EKS Cluster We use the EKS module to create a Kubernetes cluster: I've previously detailed deploying microservices on...