KEMBAR78
컨테이너, AWS에서 날개를 달다 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Master 온라인 세미나 | PDF
유재석 솔루션즈 아키텍트, AWS
컨테이너, AWS에서 날개를 달다
AWS Game Master 온라인 세미나
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
늘어나는 컨테이너를 어떻게 관리할까?
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
컨테이너 오케스트레이션(Orchestration)
myJob: {
Cpu: 10
Mem: 256
}
오케스트레이터
스케쥴링
“myJob” 을
실행해줘
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
파드(Pods)
쿠버네티스 기본 실행 단위
하나 이상의 컨테이너로 구성
파드 내 공유자원:
• 저장소
• 네트워크 주소
IP
Container A
Container B
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
파드의 개수를 보장
파드의 위치를 자동으로 결정
개선 사항이 있을 경우 자동 업데이트
디플로이먼트(Deployments)
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
서비스(Services)
파드들을 묶어서 트래픽을 받을 수 있게 해주는 것
IP
IP
IP
Service
IP
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
N개의 컨테이너를 띄운다면
Host 1
Host 2
Host 3
디플로이먼트를 정의하고 리플리카(replicas)를
3으로 설정
deploymentkubectl
rep = 3
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
스케일 아웃이 필요할땐
Host 1
Host 2
Host 3
더 많은 컨테이너가 필요하면
리플리카셋을 업데이트!
deploymentkubectl
rep = 5
새 파드들이 클러스터에서 실행
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
비정상 종료 상황
Host 1
Host 2
Host 3
호스트가 죽었어요!
컨테이너가 죽었어요!
Replication
set
rep = 5
쿠버네티스가 5개중에 3개의 파드만
실행중인것을 인지하고 2개의 파드를
추가로 실행시킴
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Kubernetes on AWS
관리형 쿠버네티스
높은 가용성 자동 버전
업데이트
다른 AWS
서비스와 연동
Etcd
Master
관리형
컨트롤
플레인
CloudTrail,
CloudWatch, ELB,
IAM, VPC, PrivateLink
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
가용영역 1
마스터 노드 마스터 노드
가용영역 2 가용영역 3
마스터 노드
워커 노드 워커 노드 워커 노드
고객 관리 VPC
AWS 관리 VPC
마스터 노드 관리
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IAM 인증
Kubectl
3) Authorizes AWS Identity with RBAC
K8s API
1) Passes AWS Identity
2) Verifies AWS Identity
4) K8s action
allowed/denied
AWS Auth
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EKS 버전 업데이트
• 컨트롤 플레인은 AWS에서 자동 업데이트
• 데이터 플레인은 사용자가 직접 업데이트
1. 새 버전의 워커 노드 준비
2. 구 워커 노드에서 새 파드 수행 정지
3. 구 워커 노드의 파드를 새 워커 노드로 이동
4. 구 워커 노드 제거
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
EKS 최적화 AMI 제공
• EKS 최적화 AMI
• GPU 지원 최적화 AMI
• 커스텀 최적화 AMI 빌드 스크립트 제공
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
컨테이너 서비스 로드맵 (EKS, ECS, Fargate)
https://github.com/aws/containers-roadmap
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS : 클러스터(Cluster)
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS : 작업(Task)
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon ECS : 서비스(Service)
EC2 INSTANCES
LOAD
BALANCER
Internet
ECS
AGENT
TASK
Container
TASK
Container
ECS
AGENT
TASK
Container
TASK
Container
AGENT COMMUNICATION
SERVICE
Amazon ECS
API
CLUSTER MANAGEMENT
ENGINE
KEY/VALUE STORE
ECS
AGENT
TASK
Container
TASK
Container
LOAD
BALANCER
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
작업 로그를 CloudWatch Logs로
CloudWatch Logs Amazon S3
Amazon Kinesis
AWS Lambda
Amazon ElasticSearch
Amazon ECS Store
Stream
Process
Search
CloudWatch Logs
CloudWatch Logs
CloudWatch Logs
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
IAM Task 역할(Role)
AWS IAM
Amazon
DynamoDB
S3
AWS IAM
DynamoDBRole
S3Role
Amazon
ECS
IAM Task
Role
Identity
Access
Management
(IAM)
ECS Task
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CloudWatch ECS 지표(Metric)
2 Dimensions
• ClusterName
• ServiceName
4 metrics
• CPUReservation
• MemoryReservation
• CPUUtilization
• MemoryUtilization
Container
Instance
…
Cluster
Task
definition
Task
Service
CloudWatch
ECS Metrics
CloudWatch
EC2 Metrics
Container
Instance
Container
Instance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
ECS Cluster (EC2 Instance) Auto Scaling
Event: Per cluster CPU, memory
reservation, or usage
New services
ECS
ECS cluster
CloudWatch
Developers
CloudWatch event
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Service Auto Scaling
CPUTraffic
DesiredCount
Time
100%
0%
50%
10%
20%
30%
40%
60%
70%
80%
90%
5
30
10
15
20
25
Target CPU Utilization DesiredCount
Amazon EC2
Service
Resource
buffer
(+~15%)
CloudWatch
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
간결하고, 쉽고, 효율적인
서버리스
컨테이너!
=관리할 EC2가
전혀 없음
ECS의 기능은 그대로 CPU, 메모리
사용양에 따라
과금
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS ECS
Scheduling and Orchestration
Cluster Manager Placement Engine
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
ECS
AMI
Docker
agent
ECS
agent
EC2 Instance
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS Fargate
Scheduling and Orchestration
Cluster Manager Placement Engine
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Amazon EC2와 Fargate의 하이브리드 구성
ECS Instance ECS Instance ECS Instance ECS InstanceECS Instance ECS Instance
EC2
FARGATE
Notifications
Amazon ECS CLUSTER
Availability Zone #1 Availability Zone #2 Availability Zone #3
Subnet 2
172.31.2.0/24
Subnet 1
172.31.1.0/24
Subnet 3
172.31.3.0/24
Web
Shopping
Cart
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
CPU와 메모리 용량 범위
CPU Memory
256 (.25 vCPU) 512MB, 1GB, 2GB
512 (.5 vCPU) 1GB to 4GB
1024 (1 vCPU) 2GB to 8GB
2048 (2 vCPU) 4GB to 16GB
4096 (4 vCPU) 8GB to 30GB
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
Fargate 작업 스토리지
계층 스토리지(Layer Storage Space) :
• 10 GB의 Docker 계층 스토리지
휘발성 스토리지 제공
볼륨 마운트를 위한 스토리지:
• 작업 당 4 GB 의 볼륨 스토리지
• 작업 내 모든 컨테이너에서 공유 가능
Image Layers
Writable Layer
Image Layers
Writable Layer
Container 1 Container 2
10 GB per Task
Container 1 Container 2
4 GB Volume Storage
mount
/var/container1/data /var/container2/data
© 2019, Amazon Web Services, Inc. or its Affiliates. All rights reserved.
AWS 디지털 교육
추천 교육 과정
• AWS Cloud Practitioner Essentials (Second Edition) (Korean)
AWS 클라우드의 기초를 배우고, 기본 자격증인 AWS Certified Cloud
Practitioner 시험을 준비하세요.
• Amazon DynamoDB for Serverless Architectures
이 과정은 Amazon DynamoDB가 무엇이고 서버리스 아키텍쳐를
구축하는 데 어떻게 활용되는지 소개합니다.
• AWS Security Fundamentals (Korean)
이 과정은 기초적인 클라우드 컴퓨팅을 비롯해 AWS 액세스 제어 및 관리,
거버넌스, 로깅 및 암호화 방법 등 AWS의 보안 개념을 소개합니다.
• Getting Started with Amazon Simple Storage Service (Amazon S3)
이 과정은 S3의 일반적인 사용 사례를 통해 어떻게 S3가 애플리케이션에
객체 스토리지를 제공하는지 소개하며, 언제 S3를 활용해야 하는지 알려
드립니다.
자신의 속도에 맞춰 학습하세요.
무료 AWS 디지털 교육을 통해
편한 시간에 원하는 장소에서
최신 클라우드 기술을
학습할 수 있습니다.
더 나은 세미나를 위해
여러분의 의견을 남겨주세요!

컨테이너, AWS에서 날개를 달다 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Master 온라인 세미나

  • 1.
    유재석 솔루션즈 아키텍트,AWS 컨테이너, AWS에서 날개를 달다 AWS Game Master 온라인 세미나
  • 2.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 늘어나는 컨테이너를 어떻게 관리할까?
  • 3.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 컨테이너 오케스트레이션(Orchestration) myJob: { Cpu: 10 Mem: 256 } 오케스트레이터 스케쥴링 “myJob” 을 실행해줘
  • 4.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 파드(Pods) 쿠버네티스 기본 실행 단위 하나 이상의 컨테이너로 구성 파드 내 공유자원: • 저장소 • 네트워크 주소 IP Container A Container B
  • 5.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 파드의 개수를 보장 파드의 위치를 자동으로 결정 개선 사항이 있을 경우 자동 업데이트 디플로이먼트(Deployments)
  • 6.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 서비스(Services) 파드들을 묶어서 트래픽을 받을 수 있게 해주는 것 IP IP IP Service IP
  • 7.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. N개의 컨테이너를 띄운다면 Host 1 Host 2 Host 3 디플로이먼트를 정의하고 리플리카(replicas)를 3으로 설정 deploymentkubectl rep = 3
  • 8.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 스케일 아웃이 필요할땐 Host 1 Host 2 Host 3 더 많은 컨테이너가 필요하면 리플리카셋을 업데이트! deploymentkubectl rep = 5 새 파드들이 클러스터에서 실행
  • 9.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 비정상 종료 상황 Host 1 Host 2 Host 3 호스트가 죽었어요! 컨테이너가 죽었어요! Replication set rep = 5 쿠버네티스가 5개중에 3개의 파드만 실행중인것을 인지하고 2개의 파드를 추가로 실행시킴
  • 10.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Kubernetes on AWS 관리형 쿠버네티스 높은 가용성 자동 버전 업데이트 다른 AWS 서비스와 연동 Etcd Master 관리형 컨트롤 플레인 CloudTrail, CloudWatch, ELB, IAM, VPC, PrivateLink
  • 11.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 가용영역 1 마스터 노드 마스터 노드 가용영역 2 가용영역 3 마스터 노드 워커 노드 워커 노드 워커 노드 고객 관리 VPC AWS 관리 VPC 마스터 노드 관리
  • 12.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. IAM 인증 Kubectl 3) Authorizes AWS Identity with RBAC K8s API 1) Passes AWS Identity 2) Verifies AWS Identity 4) K8s action allowed/denied AWS Auth
  • 13.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. EKS 버전 업데이트 • 컨트롤 플레인은 AWS에서 자동 업데이트 • 데이터 플레인은 사용자가 직접 업데이트 1. 새 버전의 워커 노드 준비 2. 구 워커 노드에서 새 파드 수행 정지 3. 구 워커 노드의 파드를 새 워커 노드로 이동 4. 구 워커 노드 제거
  • 14.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. EKS 최적화 AMI 제공 • EKS 최적화 AMI • GPU 지원 최적화 AMI • 커스텀 최적화 AMI 빌드 스크립트 제공
  • 15.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 컨테이너 서비스 로드맵 (EKS, ECS, Fargate) https://github.com/aws/containers-roadmap
  • 16.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon ECS EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 17.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon ECS : 클러스터(Cluster) EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 18.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon ECS : 작업(Task) EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 19.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon ECS : 서비스(Service) EC2 INSTANCES LOAD BALANCER Internet ECS AGENT TASK Container TASK Container ECS AGENT TASK Container TASK Container AGENT COMMUNICATION SERVICE Amazon ECS API CLUSTER MANAGEMENT ENGINE KEY/VALUE STORE ECS AGENT TASK Container TASK Container LOAD BALANCER
  • 20.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 작업 로그를 CloudWatch Logs로 CloudWatch Logs Amazon S3 Amazon Kinesis AWS Lambda Amazon ElasticSearch Amazon ECS Store Stream Process Search CloudWatch Logs CloudWatch Logs CloudWatch Logs
  • 21.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. IAM Task 역할(Role) AWS IAM Amazon DynamoDB S3 AWS IAM DynamoDBRole S3Role Amazon ECS IAM Task Role Identity Access Management (IAM) ECS Task
  • 22.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. CloudWatch ECS 지표(Metric) 2 Dimensions • ClusterName • ServiceName 4 metrics • CPUReservation • MemoryReservation • CPUUtilization • MemoryUtilization Container Instance … Cluster Task definition Task Service CloudWatch ECS Metrics CloudWatch EC2 Metrics Container Instance Container Instance
  • 23.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. ECS Cluster (EC2 Instance) Auto Scaling Event: Per cluster CPU, memory reservation, or usage New services ECS ECS cluster CloudWatch Developers CloudWatch event
  • 24.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Service Auto Scaling CPUTraffic DesiredCount Time 100% 0% 50% 10% 20% 30% 40% 60% 70% 80% 90% 5 30 10 15 20 25 Target CPU Utilization DesiredCount Amazon EC2 Service Resource buffer (+~15%) CloudWatch
  • 25.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. 간결하고, 쉽고, 효율적인 서버리스 컨테이너! =관리할 EC2가 전혀 없음 ECS의 기능은 그대로 CPU, 메모리 사용양에 따라 과금
  • 26.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS ECS Scheduling and Orchestration Cluster Manager Placement Engine ECS AMI Docker agent ECS agent EC2 Instance ECS AMI Docker agent ECS agent EC2 Instance ECS AMI Docker agent ECS agent EC2 Instance
  • 27.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS Fargate Scheduling and Orchestration Cluster Manager Placement Engine
  • 28.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Amazon EC2와 Fargate의 하이브리드 구성 ECS Instance ECS Instance ECS Instance ECS InstanceECS Instance ECS Instance EC2 FARGATE Notifications Amazon ECS CLUSTER Availability Zone #1 Availability Zone #2 Availability Zone #3 Subnet 2 172.31.2.0/24 Subnet 1 172.31.1.0/24 Subnet 3 172.31.3.0/24 Web Shopping Cart
  • 29.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. CPU와 메모리 용량 범위 CPU Memory 256 (.25 vCPU) 512MB, 1GB, 2GB 512 (.5 vCPU) 1GB to 4GB 1024 (1 vCPU) 2GB to 8GB 2048 (2 vCPU) 4GB to 16GB 4096 (4 vCPU) 8GB to 30GB
  • 30.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. Fargate 작업 스토리지 계층 스토리지(Layer Storage Space) : • 10 GB의 Docker 계층 스토리지 휘발성 스토리지 제공 볼륨 마운트를 위한 스토리지: • 작업 당 4 GB 의 볼륨 스토리지 • 작업 내 모든 컨테이너에서 공유 가능 Image Layers Writable Layer Image Layers Writable Layer Container 1 Container 2 10 GB per Task Container 1 Container 2 4 GB Volume Storage mount /var/container1/data /var/container2/data
  • 31.
    © 2019, AmazonWeb Services, Inc. or its Affiliates. All rights reserved. AWS 디지털 교육 추천 교육 과정 • AWS Cloud Practitioner Essentials (Second Edition) (Korean) AWS 클라우드의 기초를 배우고, 기본 자격증인 AWS Certified Cloud Practitioner 시험을 준비하세요. • Amazon DynamoDB for Serverless Architectures 이 과정은 Amazon DynamoDB가 무엇이고 서버리스 아키텍쳐를 구축하는 데 어떻게 활용되는지 소개합니다. • AWS Security Fundamentals (Korean) 이 과정은 기초적인 클라우드 컴퓨팅을 비롯해 AWS 액세스 제어 및 관리, 거버넌스, 로깅 및 암호화 방법 등 AWS의 보안 개념을 소개합니다. • Getting Started with Amazon Simple Storage Service (Amazon S3) 이 과정은 S3의 일반적인 사용 사례를 통해 어떻게 S3가 애플리케이션에 객체 스토리지를 제공하는지 소개하며, 언제 S3를 활용해야 하는지 알려 드립니다. 자신의 속도에 맞춰 학습하세요. 무료 AWS 디지털 교육을 통해 편한 시간에 원하는 장소에서 최신 클라우드 기술을 학습할 수 있습니다.
  • 32.
    더 나은 세미나를위해 여러분의 의견을 남겨주세요!