AWS ECS/EKS

ECS and EKS are AWS's two managed container orchestration options. ECS (Elastic Container Service) is AWS-native with a simpler operational model; EKS (Elastic Kubernetes Service) is managed Kubernetes — more portability and ecosystem power, but more complexity. Both can run on Fargate (serverless containers) or on EC2 instances you manage.

The guiding principle: don't reach for orchestration just because you have "containers." If a managed PaaS or serverless option fits, it's often simpler. When you do need orchestration, start with ECS unless you specifically need Kubernetes.

TL;DR

Quick Example

An ECS task definition describes how to run a container; a service keeps N of them running:

ECS Concepts

Fargate vs EC2 launch type

EKS Concepts

EKS gives you full Kubernetes primitives — deployments, services, ingresses, namespaces, RBAC, autoscaling, and scheduling. But you still own significant operations: cluster upgrades, node group management (unless using Fargate/serverless nodes), and observability. See Kubernetes.

When to Use Which

Choose ECS when your workload is straightforward microservices, you value AWS integration and simplicity, and you want fewer moving parts than Kubernetes.

Choose EKS when you need Kubernetes features and ecosystem (service mesh, operators, Helm), want cross-cloud portability (at the cost of complexity), and have platform engineers to run it well.

Best Practices

Common Mistakes

Wrong resource limits

Reaching for EKS by default

FAQ

ECS or EKS — which should I start with?

Start with ECS, ideally on Fargate. It covers the majority of microservice workloads with far less operational overhead than Kubernetes. Move to EKS when you specifically need Kubernetes APIs and ecosystem (operators, service mesh, Helm charts), want multi-cloud portability, or your team already runs Kubernetes elsewhere.

What's the difference between Fargate and the EC2 launch type?

Fargate is serverless: AWS provisions and manages the compute hosts, you just define and run tasks, and you pay per task's vCPU/memory. The EC2 launch type means you run and manage a fleet of EC2 instances that host your containers — more control over the hardware and potentially lower cost at scale, but you own patching and capacity. Most teams start with Fargate.

Do I even need ECS or EKS?

Not always. If your app fits a managed PaaS (App Runner, Cloud Run) or serverless (Lambda), those are simpler and need no orchestrator. Reach for ECS/EKS when you have multiple long-running containerized services that need orchestration, service discovery, and controlled rollouts.

Who owns cluster upgrades on EKS?

You do (the control plane is managed, but worker nodes and add-ons aren't, unless you use Fargate profiles). Unclear ownership of EKS upgrades is a common operational gap — assign it explicitly, keep Kubernetes versions current, and test upgrades in a non-prod cluster first.

Related Topics

References