Lesson 2 of 8 Modernization Patterns

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 App2Container containerises applications.

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.

Amazon ECS
ModelAWS-native orchestrator
StrengthsSimplicity, deep AWS integration, no control plane charge
Hybrid optionsECS Anywhere
Choose whenThe team wants the least operational effort on AWS
Amazon EKS
ModelManaged Kubernetes
StrengthsKubernetes standardisation, portability, a large ecosystem of tools
Hybrid optionsEKS Hybrid Nodes, EKS Anywhere
Choose whenThe organisation has standardised on Kubernetes or needs portability

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.

Getting applications into containers

Existing applications can be containerised without rewriting them. App2Container analyses running Java and .NET applications, identifies their dependencies and configuration, and generates container images together with the files needed to deploy them on ECS or EKS. 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.

Worked example

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             App2Container output pushed to ECR,    Existing images to ECR with cross-Region
                   scanned by Inspector                   replication
Deployment         ECS native blue/green deployments      Existing GitOps tooling against EKS

Both 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.

Check yourself

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 Java or .NET application, use App2Container.
  • EKS Auto Mode manages cluster nodes for you.