Container Orchestration — ECS, EKS, AKS, GKE Comparison and Use Cases
In this tutorial, you'll learn about Container Orchestration. We cover key concepts, practical examples, and best practices to help you understand and apply this topic effectively.
Container Orchestration automates the deployment, scaling, networking, and management of containerized applications across clusters of machines.
What You'll Learn
Compare AWS ECS, EKS, Azure AKS, and Google GKE across features, pricing, scaling, and ease of use, and choose the right platform for your container workloads.
Why It Matters
Containers are the standard deployment unit for modern applications. Choosing the wrong orchestrator leads to operational overhead, vendor lock-in, or excessive costs. Docker containers and Kubernetes skills are essential for cloud-native engineers. DodaTech runs its Microservices on ECS Fargate for Serverless containers.
Real-World Use
A fintech startup starts with ECS for simplicity, migrates to EKS as their team grows and needs Kubernetes-native tooling, and eventually runs GKE for GPU-accelerated ML model serving.
Platform Comparison
| Feature | ECS | EKS | GKE | AKS |
|---|---|---|---|---|
| Management | AWS-managed | AWS-managed control plane | Google-managed | Azure-managed |
| Pricing | No cluster fee | $0.10/hour per cluster | $0.10/hour per cluster (standard) | Free control plane |
| Serverless option | Fargate | Fargate | Autopilot | Serverless (preview) |
| Kubernetes version | N/A (AWS native) | Latest + 3 prev | Latest + 2 prev | Latest + 2 prev |
| GPU support | Yes (EC2) | Yes | Yes (optimized) | Yes |
| Windows containers | Yes | Yes | No | Yes |
AWS ECS Deep Dive
ECS is AWS's native container orchestrator. It integrates deeply with other AWS services without the complexity of Kubernetes.
# task-definition.json
{
"family": "dodatech-api",
"networkMode": "awsvpc",
"requiresCompatibilities": ["FARGATE"],
"cpu": "512",
"memory": "1024",
"containerDefinitions": [
{
"name": "api",
"image": "dodatech/api:latest",
"portMappings": [
{"containerPort": 3000, "protocol": "tcp"}
],
"environment": [
{"name": "DB_HOST", "value": "database.dodatech.internal"}
],
"logConfiguration": {
"logDriver": "awslogs",
"options": {"awslogs-group": "/ecs/dodatech-api"}
}
}
]
}
Expected behavior: ECS Fargate launches the container without managing EC2 instances, attaches to the VPC, and ships logs to CloudWatch.
Kubernetes on EKS, GKE, and AKS
Kubernetes provides a consistent API across cloud providers but each managed service differs in setup and features.
# Create an EKS cluster
eksctl create cluster \
--name dodatech-prod \
--region us-east-1 \
--nodegroup-name standard \
--node-type t3.medium \
--nodes 3 \
--nodes-min 1 \
--nodes-max 10 \
--managed
# Deploy an application
kubectl create deployment api --image=dodatech/api:latest
kubectl expose deployment api --port=3000 --type=LoadBalancer
Expected behavior: eksctl creates a fully managed EKS cluster with a node group. The deployment runs 3 replicas behind a load balancer.
flowchart TD A[Developer] -->|kubectl apply| B[Kubernetes API] B --> C[Deployment Controller] C --> D[ReplicaSet] D --> E[Pod 1] D --> F[Pod 2] D --> G[Pod 3] B --> H[Service] H --> I[Load Balancer] I --> E I --> F I --> G style B fill:#48f,color:#fff style H fill:#4a4,color:#fff
When to Choose Each Platform
| Scenario | Recommended Platform |
|---|---|
| Simple, AWS-native apps | ECS Fargate |
| Multi-Cloud or on-prem | EKS or GKE (open standard) |
| GPU/ML workloads | GKE (TPU support, optimized GPU) |
| .NET/Windows apps | AKS (best Windows container support) |
| Minimal ops team | ECS Fargate or GKE Autopilot |
| Maximum control | EKS with self-managed node groups |
Common Errors
- Running stateful workloads without persistent volumes: Containers are ephemeral. Always use EBS, EFS, or CSI drivers for persistent storage.
- Using default resource limits: Without CPU/memory limits, a single container can starve the entire node. Always set requests and limits.
- Forgetting to configure pod anti-affinity: All pods might schedule on the same node, creating a single point of failure. Use pod anti-affinity rules.
- Mixing Fargate and EC2 launch types in the same ECS service: A service must use one launch type. Use separate services for Fargate and EC2 workloads.
- Ignoring cluster autoscaler: Without cluster autoscaler, new pods remain pending if nodes are full. Enable autoscaler for elastic workloads.
- Hardcoding configuration in container images: Use ConfigMaps and Secrets for environment-specific configuration. Rebuild images only for code changes.
Practice Questions
- What is the difference between ECS Service Auto Scaling and Cluster Auto Scaling? Service auto scaling adjusts the desired task count. Cluster auto scaling adds or removes EC2 nodes.
- When would you choose ECS over EKS? When you need deep AWS integration with minimal operational complexity. ECS manages the control plane completely.
- How does GKE Autopilot differ from standard GKE? Autopilot manages the entire node infrastructure. Standard GKE gives you control over node configuration and maintenance.
- What is a pod and how does it relate to a container? A pod is the smallest Kubernetes compute unit. It wraps one or more containers that share networking and storage.
- Challenge: A company needs to deploy 50 Microservices with varying resource profiles. Some are stateless APIs, some run batch jobs, and others use GPUs. Design a container Orchestration strategy across two cloud providers.
Mini Project
Deploy a sample Microservices application on ECS Fargate:
- Create an ECS cluster with Fargate launch type
- Define a task definition with two containers (API and sidecar logger)
- Create an ECS service with auto scaling (min 2, max 10)
- Set up an Application Load Balancer to route traffic
- Configure CloudWatch logging and alarms
- Simulate a deployment update and verify zero-downtime rollout
- Migrate the same application to EKS and compare the setup effort
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro