Skip to main content

Containers

หมวดหมู่ Containers คือบริการสำหรับสร้าง deploy และจัดการ containerized applications บน AWS รองรับทั้ง Docker และ Kubernetes


Amazon ECS (Elastic Container Service)

คืออะไร: บริการจัดการ Docker containers แบบ fully managed รองรับทั้งการรันบน EC2 และ Fargate (serverless)

ราคา:

  • บน EC2: จ่ายแค่ EC2 instances ที่ใช้
  • บน Fargate: $0.04048/vCPU-hour, $0.004445/GB-hour

เหมาะสำหรับ:

  • Microservices architecture
  • Web application และ API ที่ containerized
  • ทีมที่ต้องการ managed container platform

Use Case ตัวอย่าง:

บริษัท Fintech แยก monolith ออกเป็น 10 microservices แต่ละ service รันเป็น ECS Task บน Fargate ทำให้ scale แต่ละ service อิสระ และ deploy แยกกันได้


Amazon EKS (Elastic Kubernetes Service)

คืออะไร: บริการ managed Kubernetes cluster — AWS จัดการ control plane (master nodes) ให้อัตโนมัติ คุณดูแลแค่ worker nodes

ราคา:

  • Cluster: $0.10/ชั่วโมง (~$72/เดือน) ต่อ cluster
  • Worker nodes: จ่ายตาม EC2 หรือ Fargate ที่ใช้

เหมาะสำหรับ:

  • ทีมที่ใช้ Kubernetes อยู่แล้ว
  • Enterprise workloads ที่ต้องการ portability
  • Multi-cloud strategy

Use Case ตัวอย่าง:

บริษัท SaaS ย้าย Kubernetes cluster จาก on-premise มา EKS โดยแทบไม่เปลี่ยน YAML configs เลย ลด ops overhead ในการดูแล control plane ลง 80%


AWS Fargate

คืออะไร: Serverless compute engine สำหรับ containers — ไม่ต้องจัดการ EC2 instances เลย รันได้ทั้งบน ECS และ EKS

ราคา:

  • vCPU: $0.04048/ชั่วโมง
  • Memory: $0.004445/GB/ชั่วโมง
  • ตัวอย่าง: Task 0.5 vCPU + 1 GB ≈ $0.022/ชั่วโมง

เหมาะสำหรับ:

  • ทีมเล็กที่ไม่มี DevOps ดูแล infrastructure
  • Batch jobs และ scheduled tasks
  • Development/staging environments

Use Case ตัวอย่าง:

Startup ใช้ Fargate รัน API containers โดยไม่ต้องมี DevOps engineer ดูแล server เลย จ่ายแค่ตอน container รัน ลด cost ได้ 40% เทียบกับ EC2 ที่รันตลอด


Amazon ECR (Elastic Container Registry)

คืออะไร: Docker container image registry ที่ fully managed บน AWS เหมือน DockerHub แต่ integrate กับ AWS services ได้ดีกว่า

ราคา:

  • Storage: $0.10/GB/เดือน
  • Data transfer ออก: $0.09/GB (แรก)
  • Free Tier: 500 MB/เดือน (1 ปีแรก)

เหมาะสำหรับ:

  • เก็บ Docker images สำหรับ ECS/EKS
  • Private registry ที่ปลอดภัย
  • CI/CD pipeline ที่ push/pull images

Use Case ตัวอย่าง:

ทีม DevOps ตั้ง CI/CD pipeline: GitHub Actions build Docker image → push ขึ้น ECR → ECS pull มา deploy อัตโนมัติ ทุกครั้งที่ merge code เข้า main branch


AWS App Runner

คืออะไร: บริการ deploy containerized web application และ API แบบง่ายที่สุด แค่ point ไปที่ source code หรือ container image

ราคา:

  • Compute: $0.064/vCPU-hour (active), $0.007/vCPU-hour (idle)
  • Memory: $0.007/GB-hour

เหมาะสำหรับ:

  • Developer ที่ต้องการ deploy เร็วสุดๆ
  • Web APIs, backend services
  • ไม่ต้องการยุ่งกับ infrastructure เลย

Use Case ตัวอย่าง:

Developer คนเดียว deploy FastAPI application จาก GitHub repo ไปยัง App Runner ในเวลา 5 นาที โดยไม่ต้องตั้งค่า Load Balancer, Auto Scaling หรือ SSL certificate เลย