Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
AWS ECS の説明 /aws-ecs-introduction
Search
yutachaos
October 01, 2018
Technology
0
83
AWS ECS の説明 /aws-ecs-introduction
サポーターズ下記勉強会用資料
https://supporterzcolab.com/event/522/
yutachaos
October 01, 2018
Tweet
Share
More Decks by yutachaos
See All by yutachaos
JenkinsのJobを CronJobに移した話 /The story of moving Jenkins Job to CronJob
yutachaos
0
190
History of Infrastructure as a Code testing
yutachaos
2
5.2k
AWS CodePipeline 初めて触って少しハマった話 / A story that challenged AWS CodePipeline for the first time
yutachaos
0
86
gRPC in スタディサプリENGLISH / gRPC in StudySapuri ENGLISH
yutachaos
0
2.8k
AKS,EKS,GKEコマンド比較してみた /compared AKS, EKS, GKE command
yutachaos
2
2.3k
Docker + Jenkinsでバッチ実行 / Using Docker and Jenkins execution batch
yutachaos
0
250
Spring Batchの紹介
yutachaos
0
260
非エンジニア向けMarkdown 勉強会
yutachaos
1
320
Circle CI 入門
yutachaos
0
650
Other Decks in Technology
See All in Technology
カップ麺の待ち時間(3分)でわかるPartyRockアップデート
ryutakondo
0
140
DMMブックスへのTipKit導入
ttyi2
1
110
2025年に挑戦したいこと
molmolken
0
160
三菱電機で社内コミュニティを立ち上げた話
kurebayashi
1
360
2025年の挑戦 コーポレートエンジニアの技術広報/techpr5
nishiuma
0
140
Oracle Base Database Service:サービス概要のご紹介
oracle4engineer
PRO
1
16k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
6
54k
Azureの開発で辛いところ
re3turn
0
240
テストを書かないためのテスト/ Tests for not writing tests
sinsoku
1
170
【NGK2025S】動物園(PINTO_model_zoo)に遊びに行こう
kazuhitotakahashi
0
240
商品レコメンドでのexplicit negative feedbackの活用
alpicola
2
370
いま現場PMのあなたが、 経営と向き合うPMになるために 必要なこと、腹をくくること
hiro93n
9
7.7k
Featured
See All Featured
How GitHub (no longer) Works
holman
312
140k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
What's in a price? How to price your products and services
michaelherold
244
12k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
113
50k
Product Roadmaps are Hard
iamctodd
PRO
50
11k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Designing Experiences People Love
moore
139
23k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
7
570
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
A better future with KSS
kneath
238
17k
Transcript
AWS ECS
ࣗݾհ • ଜ༐ଠ • SREΤϯδχΞ • ϓϩάϥϛϯάݴޠ • Java, node,
PHP, Ruby, Go • ීஈAWSΛར༻ͨ͠γεςϜͷӡ༻ɺӡ༻վળͱ͔ͬͯ·͢ɻ • ࠷ۙEnvoyΛ͍ͬͯ͡·ͨ͠ɻ • AWS Certificated Solutions Architect • AWS Certificated DepOps Engineer
Agenda • Containerٕज़ʹ͍ͭͯͷ͓͞Β͍ • ECSʹ͍ͭͯ • ECSͷ֓೦ʹ͍ͭͯ
ContainerͬͯԿʁ
• ߓʹ͋ΔΞϨ • Container ʹ DockerͰͳ͍ɻ • DockerίϯςφܕԾԽͷ࣮ͷҰͭ • DockerΧʔωϧͱcgroupsͳͲͷٕज़Λ
Έ߹ΘͤͯɺΞϓϦέʔγϣϯͱϥϯλΠϜ ࣮ߦڥΛ·ͱΊͯ͢Δٕज़ • ίϯςφϓϩηε ͬ͘͟Γͱͨ͠ղઆ
• ΞϓϦέʔγϣϯͱ࣮ߦڥΛҰͭʹ·ͱΊ Δ͜ͱͰ։ൃͱӡ༻νʔϜ͕εϜʔζʹӡ༻ ग़དྷΔ • e.g. ϩʔΧϧͱຊ൪Ͱಉ͡Dockerfile͑ Δ!ɺΠϯϑϥνʔϜ͕Dockerfile࡞ͬͯɺ ։ൃνʔϜʹͤΔʂٯ·ͨવΓ Կ͕ྑ͍ͷʁ
• Elastic Container Serviceͷུ • AWS͕ఏڙ͢ΔίϯςφΦʔέετϨʔ γϣϯπʔϧ • e.g. kubernates,
docker swarmͱ͔ • Docker͚ͩͰग़དྷͳ͍ίϯςφͷ Scaling, ஔ, ཧΛߦ͏αʔϏε ECSʹ͍ͭͯ
ECS overview EC2 Launch type
• ECR • Elastic Container RegistryͷུɺAWS্ͰϚωʔδυʹ ӡ༻͞ΕΔɺDocker imageΛอଘ͢ΔRegistry • Cluster
• Container͕࣮ࡍʹ࣮ߦ͞ΕΔEC2Πϯελϯεͷू߹ ମ • Service • Task definitionΛͱʹͯ͠࡞͞ΕͨTaskΛ͍ͭ͘ى ಈ͢Δ͔ɺͲͷΑ͏ʹஔ͢Δͷ͔ɺͲͷϩʔυόϥϯ αʔܦ༝Ͱ௨৴͢Δ͔ͷઃఆɻTask definitionͱ1:1Ͱ ઃఆ͢Δ ༻ޠ1
• Task definition • Containerͷ࣮ߦ͢Δܗ • Task • Task definitionΛͱʹͯ͠࡞͞Εͨ
Containerͷ࣮ଶ ༻ޠ2
Task Definitionʹ͍ͭͯ • ECS্Ͱ࣮ߦ͢ΔContainerͷઃఆ • EC2ͱFargateλΠϓ͕͋Δ • ࣮ߦͤ͞Δcontainerͷimage,ར༻͢Δ ڥมɺportͷઃఆͳͲΛߦ͏
Serviceʹ͍ͭͯ • ECS্Ͱ࣮ߦ͢ΔTaskʹ͍ͭͯͷ·ͱΊΔઃఆ • Containerͷಈ͔͢ɺInstanceͷTaskஔ ઓུ • Load balancerͷport mappingͳͲΛ୲͏ɻ
ECS agent • EC2্Ͱಈ͘ɺECSͷcontainerͷঢ়ଶΛѲ͢Δ agent • ͜ͷagentࣗମdockerͰEC2ͷதͰಈ͍͍ͯΔ • EC2 typeͷ߹ɺ͜ͷECS
agentΛEC2ىಈ࣌ʹಈ͘ Α͏ʹͯ͠Clusterʹొ͢Δ
Ϣʔεέʔε Rails appΛECSͰಈ͔͢߹ • Rails appͷimageΛઃఆͨ͠Task definitionΛ࡞ • Load balancerΛ͚ͭͨServiceΛ࡞͢Δ
Sample
ղઆ • Route53Λར༻ͯ͠domainΛઃఆ • ௨৴ALBܦ༝ͰContainerʹૹΔ • ApplicationContainerͰ࡞ɺECSͰε έʔϦϯάͷཧ
Fargate launch typeʹ͍ͭͯ • ECSʹ̎ͭͷlaunch type EC2 launch typeͱ Fargate
launch type͕͋Δɻ • EC2 launch typeContainerΛಈ͔ͨ͢ΊͷEC2Λ ཧ͢Δඞཁ͕͋Δ͕ɺFargate launch typeಈ͔ͨ͢ ΊͷEC2ͷresourceΛAWSଆͰཧͯ͘͠ΕΔɻ • ཧίετ͕ݮΔ • ݸਓతʹ·ͩಋೖͨ͜͠ͱͳ͍ɻ
ECS overview Fargate Launch type
͓ΘΓʹ • ECScluster্ͰserviceͰཧ͞Εͨ container͔ΒΔtaskΛtask definitionΛͱ ʹ࡞͠ɺӡ༻͢Δػೳ • ContainerΛຊ൪ӡ༻͢Δ͜ͱ։ൃɺӡ༻త ͳϦϨʔγϣϯʹʹཱͭ
༨ஊ
Modern Web appΛߟ͑Δͱ ͖ʹศརͳϖʔδ
Twelve-factor-app • https://12factor.net/ • ݩherokuͷ Adam Wiggins͕2011ʹॻ͍ ͨmodernͳSaaSΛ࡞ΔͨΊͷํ๏ • ࣮࣭ContainerΛར༻͢ΔappΛ࡞͢Δͱ
͖ͷํ๏ͷstandardͷҰͭ
Cloud Native landscape • https://landscape.cncf.io/ • CNCF(Cloud Native Computing Foundation)
͕ఏ͍ࣔͯ͠ΔɺCloud NativeͳΞϓϦέʔ γϣϯΛનΊ্͍ͯ͘ͰͷϩʔυϚοϓ
AWS ެࣜͷࢿྉ • ެࣜͷdoc • re:InventAWS Summit, Black beltͷεϥΠ υslideshareɺಈըyoutubeʹଟ্͘
͕͍ͬͯ·͢ɻ • ࠔͬͨΒެ͕ࣜҰ൪!
ྑ͍ Container lifeΛ!