advanced

ECS / EKS

Choose managed container orchestration through ECS for AWS-native simplicity or EKS when Kubernetes portability and ecosystem fit matter.

ECS and EKS run containerized Node.js services on AWS. ECS is AWS-native orchestration with tasks, services, and Fargate or EC2 launch types. EKS is managed Kubernetes when you need portable manifests, Helm charts, and a multi-cloud skill set.

| Platform | Best when | |----------|-----------| | ECS + Fargate | Small teams want minimal cluster ops | | ECS on EC2 | You need GPU, custom AMIs, or cost tuning | | EKS | Kubernetes ecosystem and portability matter |

Both integrate with ALB ingress, IAM roles for service accounts, CloudWatch logs, and Secrets Manager. Deploy the same container image digest promoted from CI; configure CPU/memory, readiness probes, and rolling updates.

On interviews: ECS task definition versus Kubernetes Deployment, Fargate versus EC2 backing, service discovery, IRSA on EKS, and when ECS simplicity beats running a control plane.

Common pitfalls: oversized task/pod limits; missing readiness probes so traffic hits starting containers; logging to stdout without a collection agent; running cluster admin from local kubeconfig in production.

The trade-off is ECS operational simplicity versus EKS portability and ecosystem depth.

Checklist:

  • Pin images by digest in task definitions or manifests.
  • Set requests/limits and health/readiness probes.
  • Use task roles or IRSA instead of static AWS keys in containers.
  • Centralize logs and metrics from day one.