AWS Fargate vs EKS vs Lambda: Which for Running Containers in 2026?
AWS Fargate, EKS (on EC2), and Lambda containers compared for 2026 — cold start time, cost at different scales, operational overhead, and which to pick for your workload pattern.
"Just run it on Kubernetes" is not always the right answer, even inside AWS. Fargate, EKS on EC2, and Lambda containers solve overlapping problems with very different operational and cost profiles — here is an honest comparison.
Quick Comparison
| Fargate (ECS or EKS) | EKS on EC2 | Lambda (container image) | |
|---|---|---|---|
| Operational overhead | Low — no node management | High — you manage nodes, patching, scaling | Lowest — fully managed |
| Cold start | None (long-running tasks) | None (long-running pods) | Seconds, unless provisioned concurrency |
| Max runtime | Unlimited | Unlimited | 15 minutes hard limit |
| Cost at steady high load | Higher per-vCPU than EC2 | Lowest per-vCPU (especially with Spot/Savings Plans) | Can spike expensive at sustained high invocation rates |
| Cost at bursty/idle load | Pay only for running tasks | Pay for nodes even when idle | Pay only per invocation — best for spiky traffic |
| Kubernetes API access | Yes (EKS on Fargate) or no (ECS Fargate) | Full | No |
Fargate
Fargate removes node management entirely — you define a task/pod spec and AWS runs it on infrastructure you never see, whether through ECS or as an EKS Fargate profile.
# EKS Fargate profile — pods matching this selector run serverless
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
fargateProfiles:
- name: fp-default
selectors:
- namespace: default
labels:
compute-type: fargateFargate strengths:
- Zero node patching, zero capacity planning, zero cluster-autoscaler tuning
- Strong isolation — each task/pod gets its own dedicated kernel, not shared with noisy neighbors
- Scales cleanly for variable workloads without pre-provisioning nodes
Fargate weaknesses:
- Meaningfully more expensive per vCPU/GB than EC2, especially at sustained high utilization
- No DaemonSets, no host networking, no privileged pods — some Kubernetes patterns just don't work on Fargate
- Slower pod startup than an already-warm EC2 node with capacity available
When to use Fargate: Variable or moderate-scale workloads where the ops savings outweigh the per-unit cost premium, or workloads needing strong per-task isolation.
EKS on EC2
Running EKS with EC2 (or Karpenter-managed) node groups gives you full Kubernetes with the cost efficiency of owning the underlying compute.
# Karpenter NodePool — cheapest path to EKS-on-EC2 cost efficiency
apiVersion: karpenter.sh/v1
kind: NodePool
spec:
template:
spec:
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["spot", "on-demand"]
nodeClassRef:
name: defaultEKS on EC2 strengths:
- Lowest cost per vCPU/GB, especially combined with Spot instances and Savings Plans
- Full Kubernetes feature set — DaemonSets, host networking, privileged pods, custom device plugins (GPUs)
- Karpenter has made node provisioning genuinely painless — most of the historical "EC2 is more ops work" argument has narrowed significantly
EKS on EC2 weaknesses:
- Still real operational surface: node AMI updates, security patching cadence, node draining during upgrades
- Under-provisioned clusters have real capacity risk during traffic spikes that Fargate/Lambda don't have
- Multi-tenant node isolation is weaker than Fargate's dedicated-kernel model unless you invest in additional isolation
When to use EKS on EC2: Steady, predictable, high-scale workloads where per-unit cost matters, or workloads needing Kubernetes features Fargate doesn't support.
Lambda (Container Images)
Lambda supports container images up to 10GB, letting you package existing Docker workflows into a fully serverless, pay-per-invocation model.
FROM public.ecr.aws/lambda/python:3.13
COPY app.py requirements.txt ./
RUN pip install -r requirements.txt
CMD ["app.handler"]Lambda strengths:
- True pay-per-invocation — genuinely the cheapest option for spiky, low-average-utilization workloads
- Zero infrastructure to manage, ever — no cluster, no tasks, no nodes
- Scales to zero and back up automatically without any configuration
Lambda weaknesses:
- 15-minute hard execution limit rules out long-running jobs entirely
- Cold starts are real, especially for larger container images — provisioned concurrency mitigates this but adds cost back
- Cost curve inverts at high sustained invocation rates — a busy Lambda function can cost more than the equivalent Fargate task doing the same work continuously
When to use Lambda: Event-driven, bursty, or infrequent workloads where "always-on" compute would sit idle most of the time.
The Honest Verdict
Predictable, high-scale, steady workloads: EKS on EC2 with Karpenter. The cost advantage compounds fast at scale, and Karpenter has closed most of the operational gap.
Variable workloads, want to skip node management entirely: Fargate. Pay the per-unit premium for genuinely zero ops.
Spiky, event-driven, or infrequent: Lambda. Nothing beats true pay-per-invocation for workloads that are idle most of the time.
Many production architectures at scale actually run all three — Lambda for event handlers, Fargate for the moderate-traffic API tier, EKS on EC2 for the steady-state high-throughput backend — matched to each workload's actual traffic shape rather than picking one compute model for everything.
More AWS compute comparisons? Read our AWS EKS vs self-managed Kubernetes comparison and AWS Lambda vs Kubernetes Jobs for batch processing.
Today I Fixed
Short real fixes from production — posted daily
Stay ahead of the curve
Get the latest DevOps, Kubernetes, AWS, and AI/ML guides delivered straight to your inbox. No spam — just practical engineering content.
Related Articles
AWS EKS vs Self-Managed Kubernetes in 2026: Which to Choose
EKS vs running Kubernetes yourself on EC2 — compared on cost, operational burden, control plane HA, upgrades, and when self-managed actually makes sense for teams in 2026.
ArgoCD vs Spinnaker vs Flux: GitOps Continuous Delivery Comparison 2026
ArgoCD, Spinnaker, and Flux CD compared for Kubernetes continuous delivery in 2026 — GitOps approach, multi-cluster support, canary/blue-green deployments, UI, RBAC, and which fits startups vs enterprises.
AWS EKS Cluster Autoscaler Not Scaling — Every Fix (2026)
Your EKS Cluster Autoscaler isn't scaling up, scale-down isn't working, or nodes spin up but stay empty. Here's every cause and the exact fix.