
When Does Moving from ECS to EKS Actually Make Sense?
Compare Fargate and EC2-backed EKS costs using AWS Pricing Calculator and the Price List Query API, then weigh node packing, TCO, and operational readiness before migrating.
Solution Architect @ Copa Airlines
Why this decision matters
Would moving our workloads from Amazon ECS with AWS Fargate to Amazon EKS save us money?
At first glance, this looks like an infrastructure cost question: compare prices, calculate the difference, and decide whether Kubernetes is worth adopting.
For an organization operating ten or more ECS clusters in production, the reality is more consequential. The AWS bill creates legitimate pressure to reduce cost. The platform may already deliver continuous deployments, hotfixes, and vulnerability remediation through established pipelines. A 24/7 operations team may depend on that operating model to protect customer-facing outcomes.
Stopping this machine without evidence would ignore the value it already produces. Changing it without evidence could replace one set of costs with another.
This article starts from that tension. ECS with AWS Fargate may already be a sound production platform. Introducing EKS adds Kubernetes capabilities, but also operational responsibilities, migration effort, and costs. A possible infrastructure saving is useful evidence; it is not by itself a business justification.
The more useful question is:
What problem are we trying to solve that makes changing our container platform better than improving the platform we already operate?
The original question hides two decisions:
- Should the organization change its orchestrator from ECS to EKS?
- Should it change from Fargate to EC2-backed worker capacity?
Amazon EKS supports Fargate and EC2-backed capacity. Moving to EKS does not automatically mean moving away from Fargate. An ECS/Fargate-to-EKS/EC2 comparison changes both the orchestration model and the compute model, and EC2 savings must not be attributed to Kubernetes itself.
The objective is not to prove that EKS is better. It is to determine when the move is justified and when staying on ECS is the more responsible architecture.
Who this is for
This article is for cloud architects, platform engineers, and technical decision-makers who operate containerized workloads on AWS. It assumes familiarity with ECS, containers, AWS, and basic infrastructure concepts. Deep Kubernetes expertise is helpful but not required.
The numbers below are illustrative. They establish a reproducible calculation, not a promise of production savings.
1. Start with the workload
Before evaluating another platform, inventory the workloads already running:
Attribute | Why it matters |
|---|---|
Service and desired task count | Defines baseline capacity |
Requested CPU and memory | Defines Fargate charges and pod scheduling |
Operating duration | Distinguishes continuous and intermittent workloads |
Scaling pattern | Reveals peak and baseline capacity |
Actual CPU and memory utilization | Shows over-provisioning |
Availability requirements | Sets resilience and spare capacity |
Requested resources and actual utilization are different. Fargate is billed for configured task or pod requests, not for observed CPU percentage. EC2-backed scheduling also depends on pod requests, node allocatable capacity, placement constraints, and fragmentation.
The following illustrative inventory gives 7 requested vCPU and 14 GiB across five task/pod-equivalent workloads:
{ "metadata": { "name": "illustrative-container-workload", "region": "us-east-1", "pricing_model": "public-on-demand" }, "workloads": [ { "name": "api-service", "desired_task_count": 3, "cpu_vcpu": 1, "memory_gib": 2, "operating_hours_per_month": 730, "average_cpu_utilization_percent": 35, "average_memory_utilization_percent": 55, "scaling_pattern": "stable", "availability_zones": 3 }, { "name": "background-worker", "desired_task_count": 2, "cpu_vcpu": 2, "memory_gib": 4, "operating_hours_per_month": 730, "average_cpu_utilization_percent": 60, "average_memory_utilization_percent": 65, "scaling_pattern": "variable", "availability_zones": 2 } ]}
Figure 1: Compute Billing Model — Task-Level Allocation vs. Shared Node Capacity
2. Measure the economic opportunity
Ask: Is there enough potential infrastructure savings to justify further investigation?
AWS Pricing Calculator is a useful first path. It does not require an AWS account and can model ECS/Fargate, EKS/Fargate, or EKS/EC2. It is only as accurate as the assumptions entered. Unrealistic EC2 utilization can make a result attractive while hiding the capacity needed for availability and demand peaks.
Use the calculator to form a hypothesis, not to approve the migration.
Figure 2: Economic Validation Workflow — From Pricing Calculator to Reproducible API Discovery
Retrieve public prices with AWS CLI
AWS Price List Query API provides public service attributes, products, and On-Demand terms.
The API endpoint region and the product pricing location are separate concepts.
First, verify access to
pricing:DescribeServices , pricing:GetAttributeValues , and pricing:GetProducts :{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "pricing:DescribeServices", "pricing:GetAttributeValues", "pricing:GetProducts" ], "Resource": "*" } ]}
Discover ECS attributes and locations:
aws pricing describe-services \ --service-code AmazonECS \ --region us-east-1
aws pricing get-attribute-values \ --service-code AmazonECS \ --attribute-name location \ --region us-east-1
Retrieve Fargate vCPU and memory products:
aws pricing get-products \ --service-code AmazonECS \ --region us-east-1 \ --filters \ 'Type=TERM_MATCH,Field=location,Value=US East (N. Virginia)' \ 'Type=TERM_MATCH,Field=usagetype,Value=USE1-Fargate-vCPU-Hours:perCPU'
aws pricing get-products \ --service-code AmazonECS \ --region us-east-1 \ --filters \ 'Type=TERM_MATCH,Field=location,Value=US East (N. Virginia)' \ 'Type=TERM_MATCH,Field=usagetype,Value=USE1-Fargate-GB-Hours'
Retrieve the standard EKS cluster charge and EC2 worker-node charge separately:
aws pricing get-products \ --service-code AmazonEKS \ --region us-east-1 \ --filters \ 'Type=TERM_MATCH,Field=location,Value=US East (N. Virginia)' \ 'Type=TERM_MATCH,Field=usagetype,Value=USE1-AmazonEKS-Hours:perCluster'
aws pricing get-products \ --service-code AmazonEC2 \ --region us-east-1 \ --filters \ 'Type=TERM_MATCH,Field=location,Value=US East (N. Virginia)' \ 'Type=TERM_MATCH,Field=instanceType,Value=m6i.large' \ 'Type=TERM_MATCH,Field=operatingSystem,Value=Linux' \ 'Type=TERM_MATCH,Field=tenancy,Value=Shared' \ 'Type=TERM_MATCH,Field=capacitystatus,Value=Used' \ 'Type=TERM_MATCH,Field=preInstalledSw,Value=NA'Inspect nested
PriceList JSON strings and terms.OnDemand dimensions. Do not select a SKU or first result without validating the returned attributes and On-Demand term. Follow NextToken until it is absent.Reproduce the infrastructure calculation
The script verifies the AWS identity, paginates Price List results, extracts the first matching On-Demand price, validates it, and calculates the three architectures. It does not create AWS resources.
#!/usr/bin/env bashset -euo pipefail
command -v aws >/dev/null || { echo "AWS CLI is required"; exit 1; }command -v jq >/dev/null || { echo "jq is required"; exit 1; }aws sts get-caller-identity >/dev/null
query_products() { local service="$1" filters="$2" output="$3" local starting_token="" : > "$output"
while true; do local response pagination_args=() if [[ -n "$starting_token" ]]; then pagination_args=(--starting-token "$starting_token") fi response="$( aws pricing get-products \ --service-code "$service" \ --region us-east-1 \ --filters "$filters" \ --no-cli-pager "${pagination_args[@]}" )" jq -c '.PriceList[] | fromjson' <<<"$response" >>"$output" starting_token="$(jq -r '.NextToken // empty' <<<"$response")" [[ -n "$starting_token" ]] || break done}
ecs_vcpu="$(mktemp "${TMPDIR:-/tmp}/ecs-vcpu.XXXXXX")"ecs_memory="$(mktemp "${TMPDIR:-/tmp}/ecs-memory.XXXXXX")"eks_products="$(mktemp "${TMPDIR:-/tmp}/eks-cluster.XXXXXX")"ec2_products="$(mktemp "${TMPDIR:-/tmp}/ec2-node.XXXXXX")"trap 'rm -f "$ecs_vcpu" "$ecs_memory" "$eks_products" "$ec2_products"' EXIT
query_products AmazonECS \ '[{"Type":"TERM_MATCH","Field":"location","Value":"US East (N. Virginia)"},{"Type":"TERM_MATCH","Field":"usagetype","Value":"USE1-Fargate-vCPU-Hours:perCPU"}]' \ "$ecs_vcpu"query_products AmazonECS \ '[{"Type":"TERM_MATCH","Field":"location","Value":"US East (N. Virginia)"},{"Type":"TERM_MATCH","Field":"usagetype","Value":"USE1-Fargate-GB-Hours"}]' \ "$ecs_memory"query_products AmazonEKS \ '[{"Type":"TERM_MATCH","Field":"location","Value":"US East (N. Virginia)"},{"Type":"TERM_MATCH","Field":"usagetype","Value":"USE1-AmazonEKS-Hours:perCluster"}]' \ "$eks_products"query_products AmazonEC2 \ '[{"Type":"TERM_MATCH","Field":"location","Value":"US East (N. Virginia)"},{"Type":"TERM_MATCH","Field":"instanceType","Value":"m6i.large"},{"Type":"TERM_MATCH","Field":"operatingSystem","Value":"Linux"},{"Type":"TERM_MATCH","Field":"tenancy","Value":"Shared"},{"Type":"TERM_MATCH","Field":"capacitystatus","Value":"Used"},{"Type":"TERM_MATCH","Field":"preInstalledSw","Value":"NA"}]' \ "$ec2_products"
extract_price() { local products="$1" # After exact filtering, select the first On-Demand price dimension. jq -rs ' [ .[] | .terms.OnDemand[]? | .priceDimensions[]? | .pricePerUnit.USD | select(. != null) | tonumber ] | first ' "$products"}
fargate_vcpu="$(extract_price "$ecs_vcpu")"fargate_memory="$(extract_price "$ecs_memory")"eks_cluster="$(extract_price "$eks_products")"ec2_instance="$(extract_price "$ec2_products")"
for price in "$fargate_vcpu" "$fargate_memory" "$eks_cluster" "$ec2_instance"; do if [[ -z "$price" || "$price" == "null" ]] || ! jq -en --argjson price "$price" '$price | type == "number" and . > 0' >/dev/null 2>&1; then echo "Required On-Demand price is missing or invalid" >&2 exit 1 fidone
requested_vcpu=7requested_gib=14hours=730node_count=3
ecs_monthly="$( jq -n --argjson vcpu "$requested_vcpu" --argjson gib "$requested_gib" \ --argjson hours "$hours" --argjson vcpu_price "$fargate_vcpu" \ --argjson memory_price "$fargate_memory" \ '$vcpu * $vcpu_price * $hours + $gib * $memory_price * $hours')"eks_fargate="$( jq -n --argjson ecs "$ecs_monthly" --argjson hours "$hours" \ --argjson cluster "$eks_cluster" '$ecs + $hours * $cluster')"eks_ec2="$( jq -n --argjson hours "$hours" --argjson nodes "$node_count" \ --argjson cluster "$eks_cluster" --argjson instance "$ec2_instance" \ '$hours * ($cluster + $nodes * $instance)')"
printf 'Fargate vCPU: $%.5f/hour\n' "$fargate_vcpu"printf 'Fargate memory: $%.5f/GiB-hour\n' "$fargate_memory"printf 'EKS cluster: $%.5f/hour\n' "$eks_cluster"printf 'EC2 m6i.large: $%.5f/hour\n' "$ec2_instance"printf '\n'printf 'ECS/Fargate: $%.2f/month\n' "$ecs_monthly"printf 'EKS/Fargate: $%.2f/month\n' "$eks_fargate"printf 'EKS/EC2: $%.2f/month\n' "$eks_ec2"
Expected output:
Fargate vCPU: $0.04048/hourFargate memory: $0.00445/GiB-hourEKS cluster: $0.10000/hourEC2 m6i.large: $0.09600/hour
ECS/Fargate: $252.28/monthEKS/Fargate: $325.28/monthEKS/EC2: $283.24/monthThe script is read-only and uses temporary files. The unit price for Fargate memory in
us-east-1 is $0.004445/GiB-hour; %.5f rounds only the display to $0.00445. The calculation retains the full precision and produces $252.28.3. Verify and stress the estimate
Check that the identity succeeds, each product matches the intended attributes, every price is numeric and positive, and the ECS/Fargate subtotal uses 7 vCPU and 14 GiB for 730 hours.
The Fargate formula is:
7 × $0.04048 × 730 + 14 × $0.004445 × 730 = $252.28Public On-Demand prices were retrieved on 2026-11-22 for
us-east-1 . Account-specific Savings Plans, Reserved Instances, negotiated discounts, credits, or existing commitments can change the effective cost.
As sensitivity, each additional
m6i.large node adds $0.096 × 730 = $70.08 per month. Four nodes raise EKS/EC2 from $283.24 to $353.32 , before EBS or IPv4.
A hypothetical 100 GiB gp3 volume at
$0.08/GiB-month and three public IPv4 addresses at $0.005/address-hour add $8.00 + 3 × 0.005 × 730 = $18.95 . Combined with four nodes: $372.27 . These are sensitivity assumptions, not Price List results or a production forecast.4. Examine EC2 capacity packing
EC2-backed EKS creates an opportunity for shared capacity, but theoretical packing is not achievable production utilization. CPU and memory must be considered independently.
Assume three nodes with 2 vCPU and 8 GiB allocatable:
Pod group | Replicas | CPU | Memory |
|---|---|---|---|
API | 3 | 0.75 vCPU | 3 GiB |
Worker | 2 | 1 vCPU | 2 GiB |
Batch | 1 | 0.5 vCPU | 5 GiB |
One feasible placement is API-1 + Worker-1 on node 1, API-2 + Worker-2 on node 2, and API-3 + Batch on node 3.
- Node 1: 0.25 vCPU and 3 GiB free.
- Node 2: 0.25 vCPU and 3 GiB free.
- Node 3: 0.75 vCPU and 0 GiB free.
The second 5-GiB batch pod cannot fit anywhere despite 1.25 aggregate vCPU remaining. Availability zones, taints, affinities, disruption budgets, autoscaling, and spare capacity can require more nodes.
Figure 3: Multidimensional Bin-Packing and Memory Fragmentation Across Worker Nodes
5. Separate infrastructure cost from TCO
The infrastructure comparison should include:
- Fargate vCPU and memory.
- EKS cluster support tier.
- EC2 worker nodes.
- EBS, public IPv4, networking, data transfer, and logs.
- Supporting load balancers or other required services.
The illustrative monthly totals are:
Architecture | Included components | Monthly estimate |
|---|---|---|
ECS/Fargate | Fargate vCPU and memory | $252.28 |
EKS/Fargate | EKS cluster + Fargate vCPU and memory | $325.28 |
EKS/EC2 | EKS cluster + three m6i.large nodes | $283.24 |
These totals exclude EBS, IPv4, networking, data transfer, logs, discounts, and account-specific charges.
Infrastructure cost is only one part of TCO. TCO also includes platform engineering, Kubernetes expertise, upgrades, add-ons, security, observability, incident response, capacity management, developer enablement, migration effort, parallel operation, training, and opportunity cost.
Figure 4: Container Platform Total Cost of Ownership (TCO) Beyond Compute
6. Identify the Kubernetes capability requirement
EKS provides Kubernetes APIs, custom resources, operators, ecosystem tooling, and a consistent Kubernetes interface. These are valuable when they solve an existing requirement. They are not valuable merely because they are available.
Before adopting an operator or another ecosystem component, identify the problem, whether ECS can solve it, and whether the organization can own the component's lifecycle, permissions, compatibility, failure behavior, and upgrades.
Figure 5: Requirement-First Capability Evaluation Filter
7. Define who will operate the platform
Deploying an EKS cluster is not the same as operating an EKS platform. Someone must own version upgrades, node lifecycle, add-ons, scheduling, networking, IAM and Kubernetes RBAC, security, observability, autoscaling, incident response, and developer enablement.
This is especially important when the current team is already competent and busy. It may be absorbing hotfixes, vulnerability remediation, deployment failures, application dependencies, and production incidents. Every hour spent learning cluster lifecycle or troubleshooting scheduling is an hour not spent improving the delivery system or protecting customer-facing outcomes.
AI agents and automation can inspect failures, draft manifests, explain events, or accelerate repetitive migration work. They reduce mechanical effort, but they cannot decide that an upgrade is safe, validate security boundaries, or accept responsibility for an unintended cost increase. Governance, validation, and cost accountability remain human responsibilities.
8. Account for the migration cost
Migrating ECS workloads is not only a deployment-target change. It may require adapting deployment definitions, pipelines, service discovery, ingress, load balancing, secrets, identity, logging, metrics, autoscaling, security controls, operational procedures, and developer workflows.
The hardest part is not replacing one deployment command. Consolidated CI/CD pipelines, approval gates, hotfix paths, security checks, and recovery procedures may already be tuned to ECS. Porting those integrations to Kubernetes manifests and controllers carries the same delivery responsibilities while introducing a new set of abstractions.
During gradual migration, ECS and EKS may operate in parallel before ECS is retired. The migration timeline belongs in the economic model.
Figure 6: ECS-to-EKS Migration Lifecycle and Parallel Operation Window
9. Make the architecture decision
The decision emerges from infrastructure economics, Kubernetes capabilities, operational ownership, organizational readiness, and migration cost.
Ask:
- Is ECS meeting the requirements?
- Is there a measurable economic opportunity?
- Does Kubernetes solve an actual requirement?
- Can the organization operate the platform?
- Does the complete migration case justify the investment?
Figure 7: End-to-End Architectural Decision Framework for ECS vs. EKS
This is not a checklist that requires every answer to be positive. A strong Kubernetes requirement may justify migration with limited infrastructure savings. Significant theoretical savings do not justify migration if the organization cannot operate the platform.
When to stay on ECS
I would stay on ECS if it satisfies the workloads, the workloads operate reliably, and there is no concrete need for Kubernetes capabilities. A small infrastructure saving is not enough to justify a platform migration.
Protecting an ECS platform that already ships code, resolves incidents, and remediates vulnerabilities is not standing still. It is preserving a machine the business depends on.
When to consider EKS
I would consider EKS for a concrete Kubernetes requirement, existing Kubernetes skills or tooling, or a strategic need for a consistent Kubernetes interface. I would also investigate EC2-backed capacity when workload characteristics suggest a meaningful packing opportunity.
The decisions remain separate: Kubernetes is not the source of EC2 cost savings.
10. The answer is not always EKS
The real decision involves workloads, compute model, infrastructure cost, required capabilities, operational ownership, migration effort, and organizational readiness.
AWS Pricing Calculator can form an economic hypothesis. AWS Price List Query API can make the calculation reproducible. Capacity and workload measurements reveal whether shared EC2 capacity is realistic.
Those tools do not decide whether the migration is the right architecture. That requires explaining what problem Kubernetes solves, what it costs to operate, and why that trade-off is better than staying on ECS.
I would not migrate to EKS simply because I can demonstrate a lower infrastructure estimate. I would migrate when the technical or strategic value exceeds the cost of ownership and the migration itself.
Sometimes the best decision is to migrate. Sometimes it is to improve the platform already operating. Sometimes it is to wait until the organization is ready.
References
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article