Compute
D3 · Performance
D4 · Cost
~1 phút đọc

Containers: ECS, EKS, Fargate

So sánh ECS (AWS native), EKS (Kubernetes) và Fargate (serverless compute cho containers).

containers
ecs
eks
fargate
kubernetes

Sơ đồ tổng quan

Đang tải sơ đồ…

Ma trận lựa chọn

  • ECS + EC2 launch type: tự quản EC2, rẻ hơn nếu utilisation cao.
  • ECS + Fargate: không quản server, scale task theo nhu cầu, billing theo vCPU-second & GB-second.
  • EKS + EC2 nodes: chuẩn Kubernetes, cần ops skill mạnh.
  • EKS + Fargate: pod chạy trên Fargate, không quản node pool.

Khi nào chọn ECS vs EKS

  • Chọn EKS nếu đã có toolchain Kubernetes hoặc cần portability multi-cloud.
  • Chọn ECS nếu muốn tích hợp sâu, đơn giản, AWS-native.
  • Fargate gần như luôn là câu trả lời khi muốn serverless container.

Networking & IAM

  • awsvpc mode: mỗi task có ENI riêng, Security Group riêng → giống VM.
  • Task role ≠ execution role. Task role cho code trong container; Execution role cho agent pull image & ghi log.
  • ECR là registry private, tích hợp IAM.
Nội dung liên quan