Upgrade to Pro — share decks privately, control downloads, hide ads and more …

higobashi.aws 第1回 AWS re:Invent 2017 報告会 AWS Fa...

Yuji Shimoda
December 14, 2017

higobashi.aws 第1回 AWS re:Invent 2017 報告会 AWS Fargate と ECS タスクネットワークのご紹介

2017年12月13日に開催したhigobashi.aws ( https://classmethod.connpass.com/event/72893/ ) の発表資料です

Yuji Shimoda

December 14, 2017
Tweet

More Decks by Yuji Shimoda

Other Decks in Technology

Transcript

  1. 'BSHBUFͷσϝϦοτ  EC2 ͱར༻අΛൺֱ͢Δͱɺ΍͸Γ͓ߴ͍
 όʔδχΞ๺෦(us-east-1)/Linux/ΦϯσϚϯυ t2.micro
 1vCPU/1(GB)Mem ͷߏ੒Ͱ $ 0.0116/h

    ֹ݄ʢ720hՔಇʣ׵ࢉ͢ΔͱҎԼͷͱ͓Γ
 t2.micro … $ 8.352/m ɹ
 Fargate … $ 45.575/m 
 
 ͜ͷ৚݅Ͱൺֱͨ͠৔߹ɺEC2 ͷ؅ཧ/ӡ༻අͱͯ͠
 ֹֹࠩۚ $37 ʢ4,000ԁʣఔ౓͕ඞཁͱͳΔ
  2. &$4λεΫωοτϫʔΫͱ͸ʁ  2017/11/14 ʹൃද͞ΕͨɺECS λεΫʢίϯςφʣʹରͯ͠
 ENI(Elastic Network Interface)ΛΞλονग़དྷΔΑ͏ʹ͢Δ৽ػೳ ٕज़తʹ͸ɺLinux ωοτϫʔΫ

    namespace ͱ ENI ͷ૊Έ߹Θͤ CNI(Container Networking Interface)ͷ࢓༷ʹج͖ͮɺ
 ECS CNI ϓϥάΠϯ͕։ൃ͞Ε͍ͯΔ
 aws/amazon-ecs-cni-plugins: Networking Plugins repository for ECS Task Networking https://github.com/aws/amazon-ecs-cni-plugins ࢀߟࢿྉʣৄղ: Amazon ECSͷλεΫωοτϫʔΫ | Amazon Web Services ϒϩά 
 https://aws.amazon.com/jp/blogs/news/under-the-hood-task-networking-for-amazon-ecs/
  3. %FNP  task network namespace Λ࡞੒ $ sudo -s #

    ip netns add task
 eth1 Λ task ωʔϜεϖʔε಺ʹҠಈͤ͞Δ # ip link set eth1 down # ip link set eth1 netns task # ip netns exec task ip link set eth1 up 

  4. %FNP  eth1 ͷ IP ΞυϨε͓ΑͼϧʔςΟϯάΛઃఆ # ip netns exec

    task ip addr add PrivateIP dev eth1 # ip netns exec task ip route add default via GatewayIP dev eth1
 task ωʔϜεϖʔε಺ͰɺWEB αʔϏεΛىಈ # echo ‘<h1>Higobashi.aws 2017 1st.</h1>’ > index.html # ip netns exec task ruby -run -e httpd . -p 80 

  5. ·ͱΊ  EC2 Πϯελϯεͷ؅ཧ͔Βղ์͞ΕΔ AWS Fargate ࠷ߴʂ re:Invent αʔϏεൃදલʹɺϦϦʔε͞ΕͨαʔϏεʢ৽ػೳʣ
 ͔ΒͲΜͳαʔϏε͕ൃද͞ΕΔ͔༧૝͢Δָ͠Έ͕͋Δ

    ࠓճͷൃදࢿྉʹهࡌ͸͋Γ·ͤΜͰ͕ͨ͠ɺݱࡏϓϨϏϡʔதͷ Amazon Elastic Container Service for Kubernetes (Amazon EKS)
 ͕଴ͪԕ͍͠