AWS/ECS

ECS 개념 정리

백셀건전지 2023. 9. 7. 11:03

ECS란?

  • Fully managed container orchestration service
  • Launch compute options
    • Fargate
      • serverless container compute engine
    • AWS Regions
      • same geographical area
    • AWS Local Zones
      • An extension of Region. Suited to customers who need the ability to place resources in multiple locations closer to end users
    • AWS Wavelength
      • Ultra-low-latency mobile edge computing. 5G apps, interactive and immersive experinces, connected vehicles.
    • AWS Outposts
      • A family of fully managed solutions delivering AWS infrastructure and services to virtually any on-premises or edge location for a truly consistent hybrid experience.
    • Amazon ECS Anywhere
      • helps customers launch containers on their self-managed compute outside of AWS
    • ECS instances

ECS의 문제점

  • Container scheduling
  • Container lifecycle management
    • 다운타임 없이 새로운 container로 변경할 수 있을지, 문제 발생 시 어떻게 탐지 할지
  • Container runtime needs
    • LB, service discovery, auto scaling, secret handling

ECS의 장점

  • Fully managed control plane
  • Fargate serverless compute engine integration
  • Native integrations with valuable AWS services or capabilities
  • Proven performance and scale
  • Powerful simplicity
  • No charge
    • EC2 instance나 EBS volume등 resource 사용량에 대해서만 과금

Fargate

  • serverless compute engine for containers that works with both ECS and EKS
  • Seamless Scaling
  • has its own boundary and does not share the underlying kernel, CPU, memory, ENI

ECS on EC2 VS Fargate

  • Networking
    • EC2는 awsvpc, bridge, none 사용
    • Fargate는 awsvpc만 사용
  • Rightsize Fargate configurations
  • Optimize spending with compute options
    • Fargate에서 spot instance사용 가능
    • graviton2 + fargate + compute savings plan layering
  • EC2에 비해 Fargate가 덜 customizable 함
  • Fargate, kernel-level, OS-level customizing 이 어려움
  • Partner integration 측면에서도 EC2 daemon으로 가능 but fargate는 sidecar 패턴으로

Service Scheduler

  • 오래 실행되는 stateless 한 서비스나 application에 적합
  • 2가지 전략
    • REPLICA: desired number of tasks across your cluster. AZ에 분산. Task placement decision을 customize하여 분산 전략 및 제한을 구성 가능
    • DAEMON: Fargate에서는 미지원. EKS 의 daemonset과 유사. Fargate에서는 X

Manually Running task

  • RunTask: 실행되고 끝나는 batch job에 적합. ex) process가 queue에 쌓일때. default task placement strategy로 한 인스턴스에 task 몰리는 것 방지.

Cron-like scheduling

  • EventBridge Scheduler로 스케줄링 가능.

Custom Scheduling

  • StartTask API와 같은 3rd party scheduler 도 사용 가능.

Service Discovery

Running Windows Containers with ECS Fargate

  • Unlike Linux applications that log to STDOUT, Windows applications log to Windows locations such as ETW, Event Log, and custom log files
  • Microsoft Log Monitor is an open source tool built by Microsoft
  • to send IIS logs and System Logs to a STDOUT pipeline created by Log Monitor
  • logs are automatically captured by awslogs driver and sent to CloudWatch logs
  • Monitoring performance with CloudWatch Container Insights
    • Container Insights collects data as performance log events using embedded metric format
    • These performance log events are entries that use a structured JSON schema that enables high-cardinality data to be ingested and stored at scale

 

 

'AWS > ECS' 카테고리의 다른 글

VPC Lattice  (0) 2023.09.22
ECS Capacity Providers  (0) 2023.09.17
App Mesh 정리  (0) 2023.09.17
ECS Networking 정리  (0) 2023.09.17
ECS Monitoring 정리  (0) 2023.09.15