Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hybrid Container Architecture: ECS & EKS Service Discovery

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

Overview

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

Why This Project?

This architecture solves several common challenges:

  1. Flexibility in platform choice: Use ECS for simple services and EKS for more complex workloads
  2. Gradual migration path: Move from ECS to EKS (or vice versa) service by service
  3. Best-of-both-worlds approach: Combine the simplicity of Fargate with the flexibility of Kubernetes
  4. Unified service discovery: Services can find and communicate with each other regardless of platform

Prerequisites

  • 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)

Quick Start

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

Project Structure

.
├── 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

Continuous Integration

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_ACCOUNT and CDK_DEFAULT_REGION variables

Optimization Features

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

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages