Choosing Target Container Platforms
This lesson explains how to choose between AWS's two container orchestrators and two capacity models, mainly from the organisation's direction and skills.
Learning outcomes
After completing this lesson, you will be able to:
- Choose between ECS and EKS.
- Choose between Fargate and EC2 capacity.
- Describe how existing applications are containerised.
ECS or EKS
Amazon ECS and Amazon EKS both run containers on EC2 or Fargate, but differ in philosophy. ECS is AWS's own orchestrator. It is simpler to operate, integrates deeply with other AWS services, has no charge for its control plane, and extends on premises with ECS Anywhere. It suits teams that want the least operational effort on AWS. EKS is managed Kubernetes. It brings Kubernetes standardisation, portability between environments and a large ecosystem of tools, and extends on premises with EKS Hybrid Nodes and EKS Anywhere. It suits organisations that have standardised on Kubernetes or need portability. The following table summarises the comparison.
Fargate or EC2 capacity
Either orchestrator can run containers on Fargate or on EC2 capacity. Fargate runs each task or pod on its own isolated compute, with no nodes to manage, patch or scale, which makes it the default for the least operational overhead. EC2 capacity suits GPU workloads, very large or steady fleets where Savings Plans and Spot reduce cost, and workloads that need host-level access, such as particular kernel settings or daemons.
EKS Auto Mode offers a middle path for Kubernetes: the cluster runs on EC2 instances, so GPUs and Spot remain available, but EKS manages the nodes, including provisioning, scaling, patching and upgrades, which removes most of the node management that self-managed node groups require.
Fargate or EC2 capacity?
Getting applications into containers
Existing applications can be containerised without rewriting them. Teams write a Dockerfile that packages the existing build output, or port .NET Framework applications to cross-platform .NET with AWS Transform for .NET first, and build images in the pipeline. The images are stored in Amazon ECR, which scans them for vulnerabilities with Inspector and replicates them to other Regions and accounts.
Containers are replaced freely, so applications that keep state on local disk need that state moved elsewhere: to EFS volumes for shared files, to a database for application data, or to S3 for objects. Applications that cannot externalise their state are better left on EC2 until they are modernised.
ECS for one team, EKS for another
Two business units are containerising their applications. Unit A has 12 Java Spring microservices, a small team with no Kubernetes experience, and a requirement for the least operational overhead. Unit B already runs Kubernetes on premises with Helm charts and operators, and wants one platform across its data centres and AWS. The architect chooses differently for each:
Unit A Unit B
Orchestrator Amazon ECS Amazon EKS
Capacity Fargate (no nodes to manage) EKS Auto Mode in AWS; EKS Hybrid Nodes on premises
Images Images built in CodeBuild, pushed to ECR, Existing images to ECR with cross-Region
scanned by Inspector replication
Deployment ECS native blue/green deployments Existing GitOps tooling against EKSBoth choices are correct for their context. ECS on Fargate gives Unit A containers without a control plane to learn or nodes to patch. EKS gives Unit B portability and its existing ecosystem, and Hybrid Nodes let the same cluster schedule pods on its on-premises servers during the transition. Forcing Kubernetes on Unit A, or ECS on Unit B, would add effort without benefit.
When does EC2 capacity suit containers better than Fargate?
Show answer
When workloads need GPUs, particular instance types, daemons or host-level access, or run at steady high utilisation where EC2 with commitments costs less.
Exam Tips
Remember for the exam
- To run containers without managing servers, use Fargate.
- For the least operational effort on AWS, choose ECS; for Kubernetes standardisation, choose EKS.
- Kubernetes both on premises and in AWS points to EKS Hybrid Nodes or EKS Anywhere.
- To containerise an existing .NET Framework application, port it with AWS Transform for .NET first.
- EKS Auto Mode manages cluster nodes for you.