This project demonstrates a hybrid container architecture that combines AWS ECS (Elastic Container Service) and EKS (Elastic Kubernetes Service) with seamless service discovery between both platforms.
Deutsche Version dieser README
Modern microservices architectures often require flexibility in choosing the most appropriate container orchestration platform for each service. This project shows how you can:
- Run different microservices on ECS and EKS simultaneously
- Enable cross-platform service discovery for seamless communication
- Leverage the simplicity of ECS Fargate with the flexibility of Kubernetes
- Deploy and manage the entire infrastructure using AWS CDK
Main components:
- Frontend Service (ECS Fargate)
- Backend Service A (ECS Fargate)
- Backend Service B (EKS Pod)
- Service Discovery via AWS Cloud Map and Kubernetes DNS
This architecture solves several common challenges:
- Flexibility in platform choice: Use ECS for simple services and EKS for more complex workloads
- Gradual migration path: Move from ECS to EKS (or vice versa) service by service
- Best-of-both-worlds approach: Combine the simplicity of Fargate with the flexibility of Kubernetes
- Unified service discovery: Services can find and communicate with each other regardless of platform
- AWS CLI configured with appropriate permissions
- Node.js and npm (for AWS CDK)
- Docker (for local testing and building containers)
- kubectl (for interacting with the EKS cluster)
The project includes optimized deployment scripts that accelerate the provisioning process:
# Deploy the entire architecture
./scripts/deploy.sh
# Scale up to full architecture after successful deployment
./scripts/scale-up.sh
# Clean up all resources
./scripts/cleanup.sh.
├── cdk/ # AWS CDK Infrastructure as Code
├── src/ # Microservices source code
│ ├── frontend/ # Frontend service
│ ├── backend-ecs/ # Backend service for ECS
│ └── backend-eks/ # Backend service for EKS
├── kubernetes/ # Kubernetes manifests
├── docs/ # Documentation
└── scripts/ # Deployment scripts
This project includes GitHub Actions workflows for continuous integration:
- CDK Synthesis Check: Automatically validates CDK infrastructure code on each push and pull request
- Ensures that infrastructure code can be properly synthesized
- Catches syntax errors and AWS CDK compatibility issues early
- Uses the GitHub Environment "secrets" for secure management of AWS account and region settings
- Configure the "secrets" environment in your GitHub repository with
CDK_DEFAULT_ACCOUNTandCDK_DEFAULT_REGIONvariables
The project implements several optimizations to speed up deployment:
- Reduced initial resource counts (replicas, nodes)
- SPOT instances for faster provisioning
- Optimized health check configurations
- Parallel Helm chart installation
This project is licensed under the MIT License. See the LICENSE file for details.