EC2 launch type và Fargate
Container đóng gói ứng dụng cùng mọi thành phần phụ thuộc để chạy nhất quán trên mọi môi trường; container vẫn cần hạ tầng tính toán, có thể là EC2 instance do đội ngũ tự quản lý hoặc AWS Fargate do AWS quản lý.
Amazon ECS và Amazon EKS đều cần hạ tầng tính toán để chạy container. Có hai lựa chọn: tự quản lý một nhóm EC2 instance, hoặc sử dụng AWS Fargate và chỉ khai báo lượng vCPU, RAM mà task yêu cầu. So sánh phạm vi trách nhiệm quản lý và cơ sở tính phí:
- EC2 launch type: tự quản lý instance, chi phí tính theo EC2 + EBS.
- Fargate: serverless, chi phí tính theo vCPU + RAM của task.
- Cả ECS và EKS đều chạy được trên Fargate.
EC2 launch type and Fargate
A container packages an application with all its dependencies so it runs consistently in any environment; containers still need compute infrastructure, either EC2 instances the team manages or AWS Fargate, which AWS manages.
Amazon ECS and Amazon EKS both need compute infrastructure to run containers. There are two options: manage a group of EC2 instances yourself, or use AWS Fargate and declare only the vCPU and memory a task needs. Compare the scope of management responsibility and the billing basis:
- EC2 launch type: you manage the instances, billed by EC2 + EBS.
- Fargate: serverless, billed by the task’s vCPU + memory.
- Both ECS and EKS can run on Fargate.