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

平成最後なのでEC2からECS+Fargateに 置き換えた話

平成最後なのでEC2からECS+Fargateに 置き換えた話

marnie0301

May 21, 2019
Tweet

More Decks by marnie0301

Other Decks in Technology

Transcript

  1.  43&5FBN&OHJOFFSBUFVSFLB *OD  -JLF  ೣɺͶ͜ɺDBUɺΩϟοτ  ࣗసं ౦ژʙઋ୆͍ͬͨΓ

      ϩέ஍ௐ΂  HBNFBOJNF  ত࿨ੜ·Ε 2 About me ɹɹMasashi Yamamoto (@marnie) 2
  2. 3 Eureka SRE Team 3  5FBN.JTTJPO7JTJPO  શγεςϜͷՄ༻ੑɺ৴པੑɺੑೳɺ։ൃޮ཰ͷ޲্ 

    Ϗδωεͷ࣮ݱͷ્֐ཱ֬Λ্͛ΔཁҼͷഉআ  ࣮ۀ຿ྫ  Πϯϑϥ؂ࢹܥͷߏங ίετϓϥϯχϯά  ηΩϡϦςΟؔ࿈΍ԣஅࢪࡦܥͷ࣮૷ɾϦʔυ  σʔλύΠϓϥΠϯͷߏஙઃܭɾϚΠΫϩαʔϏε։ൃͳͲ قઅʹΑΔ   σϓϩΠ#PU΍ύΠϓϥΠϯߏஙɾࣗಈԽͳͲ։ൃޮ཰Խ΁ͷد༩  ΞϓϦέʔγϣϯίʔυ΋ඞཁʹԠͯ͡ॻ͖·͢ɻ  Մ༻ੑ  B[ minatoku-eureka-a minatoku-eureka-c minatoku-eureka-d
  3. 5 ίϯςφԽҎલͷߏ੒ 5  QBDLFS BOTJCMFͰ࡞੒ͨ͠(PMEFO*NBHFΛ UFSSBGPSNͰల։͢Δӡ༻  *B$ 

    *NNVUBCMF*OGSBTUSVDUVSF  ֓ͶσʔλετΞͷ෼཭͕Ͱ͖͍ͯΔɻ  8FC4FSWFSͷεέʔϧΞ΢τ͸༰қɻ  ಈ࡞໘ εέʔϥϏϦςΟݎ࿚ੑ ͸େ͖ͳ՝୊΋ͳ ͘ฏ࿨ɻ
  4. 7 ࠷ॳͷ͖͔͚ͬɿΠϯϑϥ൓ө͕ͭΒ͔ͬͨ 7  QBDLFSCVJMEdຊ൪൓ө·Ͱͷίετ  ඞཁͳશͯͷϞδϡʔϧΛΠϯετʔϧ#VJMEͯ͠HPMEFO*NBHFΛ࡞Δ  UFSSBGPSNʹBNJΛ൓өˠ࠷ऴςετ 

    BVUP4DBMJOH(SPVQͷ૿ݮͰಈ࡞͍ͯ͠ΔαʔόʔΛखಈͰೖΕସ͑Δ ৽چࠞࡏ   ͜ͷ··Ͱ͸ฏ੒͕ऴΘͬͯ͠· SZ  ׂͱංେԽ͖͍ͯͯ͠ΔQMBZCPPL
  5. 8 ίϯςφྑ͍ 8  ϓϩηε୯ҐͰߏஙՄೳ  ࢖༻͢Δϛυϧ΢ΣΞಉ࢜Ͱͷґଘੑͷڝ߹ͳͲΛؾʹ͠ͳ͍ͰࡁΉɻ  मਖ਼ɾ௥ՃʹΑΔӨڹΛڱ͘ग़དྷΔɻ 

    ػೳ௥Ճɾमਖ਼͸໾ׂผʹίϯςφ୯ҐͰमਖ਼௥Ճ͕Մೳ  मਖ਼ɾ௥Ճͷ୯ҐΛখ͘͞ग़དྷΔɻ  ىಈɾഇغ͕ߴ଎  εέʔϧΞ΢τͷ଎౓޲্  JNNVUBCMFJOGSBTUSVDUVSFͷ࣮ફʹద͍ͯ͠Δ  ΞϓϦέʔγϣϯΛσϓϩΠ͢ΔΑ͏ͳײ֮ͰΠϯϑϥσϓϩΠ͕Ͱ͖Δɻ  ϙʔλϏϦςΟ  FUD
  6. 10 ٕज़બఆ: EKS or ECS on EC2 or ECS on

    Fargate 10  ىಈ଎౓΍୯७ͳՁ֨໘Ͱ͸&$PO&$4 4QPPU'MFFU ͷํ͕༏Ґ͚ͩͲʜ   νʔϜͷ؅ঠྖҬ͕޿͍ͷͰɺͳΔ΂͘ӡ༻؅ཧ͢ΔίετΛݮΒ͍͖͍ͯͨ͠ɻ  'BSHBUF͕ཧ૝త  ࠓ࣌఺Ͱ͸&,4ΑΓ&$4ͷํ͕ӡ༻ɾ"84಺ͷผίϯϙʔωϯτͱͷ࿈ܞ͕ॆ࣮͍ͯ͠Δɻ  LVCFSOFUFT΋ັྗత͚ͩͲɺ%BUB1MBOFͷNBOBHFE͖ͯɺ৭ʑރΕ͖ͯͨΒʜ
  7. 11 Ͳ͏ઃܭ͍ͯ͜͠͏ʁ 11  ίϯςφԽͷϝϦοτΛڗड͠΍͍͢ߏ੒ΛzͰ͖Δ͚ͩz࠾Δ֤छϕετϓϥΫςΟεͷ࣮ફ  5XFMWFGBDUPS"QQ  Ϟμϯͳ8FCΞϓϦέʔγϣϯΛ࣮ݱ͢ΔϕετϓϥςΫΟε 

    ίϯςφʹݶΒͳ͍ॏཁͳઃܭࢦ਑ɻ  %PDLFS#FTU1SBDUJDF  ίϯςφຖʹ̍ͭͷϓϩηε͚࣮ͩߦ ͳΔ΂͘খ͘͞   ίϯςφ͸ΤϑΣϝϥϧ ୹໋ Ͱ͋Δ΂͖ ഇغՄೳͰ͋Δ͜ͱ   ΠϝʔδϨΠϠΛ࠷খʹɺෆཁͳ΋ͷΛஔ͔ͳ͍ɺFUDʜ
  8. 12 ίϯςφߏ੒ 12  جຊ̍ϓϩηε̍ίϯςφ EPDLFSCFTUQSBDUJDF   ֤ίϯςφͷ੹຿ͱαΠζΛখ͘͞ɻ 

    BMQJOFͳͲܰྔͳ*NBHFͷར༻ɺඞཁ࠷௿ݶ͔͠ೖΕͳ͍ɻ  ͋͘·Ͱجຊํ਑ɺ෼཭͕ผͷ໰୊ΛੜΉ৔߹͸ڐ༰ɻ  ίϯςφཻ౓ʹσϓϩΠཻ౓  ҰͭҰͭͷίϯςφͷϏϧυ଎౓΍ϦϦʔε୯ҐΛখ͘͞ɻ  ؂ࢹɾ෼ੳ౳ͷػೳཁ݅ʹඞཁͳϓϩηεΛαΠυΧʔԽ  'BSHBUFͷڞ༗ϘϦϡʔϜ ্ݶ(# Λར༻  (#ͪΐͱͭΒ͍ͷͰϩʔςʔτ౳ߟྀཁɻ  ݱ࣌఺Ͱ༰ྔؔ࿈ͷϝτϦΫε͕औΕͳ͍ͷ΋ͭΒΈɻ  ͜ͷ-BZFS͔Β͜ͷ੹຿ΛऔΓ֎ͤΔͱঘྑ͍
  9. 13 ϙʔλϏϦςΟ 13  ֎෦Ϧιʔεͱͷ઀߹ͳͲͷઃఆΛ؀ڥม਺Ͱ஫ೖ  5XFMWF'BDUPS"QQ***ͷ࣮ફ  ϙʔλϏϦςΟηΩϡϦςΟΛอͭɻ 

    &$'BSHBUFىಈλΠϓͱ΋ʹɺ"841BSBNFUFS4UPSFͷىಈ࣌ಡΈࠐΈΛαϙʔτɻ  ΞϓϦέʔγϣϯଆͰಛʹ෮߸ɾ؀ڥม਺ͷઃఆͳͲΛҙࣝͤͣɺ؀ڥม਺ͷಡΈࠐΈ͕Մೳ  σϓϩΠ΋؆୯ͰɺUBTLEFpOJUJPOͷઃఆʹߦॻ͚ͩ͘ɻ όʔδϣϯࢦఆͰ͖Δͱঘخ͍͠ ŧŽ
  10. 14 σϓϩΠύΠϓϥΠϯ 14  $IBU"QQ $PEF#VJME $PEF%FQMPZ#MVF(SFFO  ಺෦తʹ͸-#ͷUBSHFU(SPVQͷ੾Γସ͑ 

    DPEF%FQMPZͷఏڙػೳͳͷͰɺ؆୯ͳઃఆͰ ࣮ݱՄೳ  σϓϩΠ࣌ͷWFSTJPOࠞࡏΛආ͚ΒΕΔ  HSFFOอ࣋ظؒʢ෼dઃఆՄೳ ͸੾Γ໭͕͠ߴ଎ɻ  σϓϩΠࣗମ͸ֻ͕͔͍࣌ؒͬͯΔҹ৅   DPEF$PNNJU DPEF1JQF-JOF࿈ܞͰϦϦʔεࣗಈ Խ΋Մೳɻ
  11. 16 ؂ࢹ&ϩΪϯά 16  TTI໰୊  جຊతʹTTI͠ͳ͍ͰࡁΉΑ͏ʹ੔උ͢Δ  ϩάपΓ͸ՄೳͳݶΓTUEPVU TUEFSSΛ࢖͏

     EFGBVMUͷBXTMPHTܦ༝ͰDMPVE8BUDIʹసૹ  ೉͍͠΋ͷ͸EBUBEPHʹసૹ  ؂ࢹϞχλϦϯά͸%BUBEPH  DQV NFNPSZ BMCMBUFODZ BMC@UBSHFU@YY YY౳  ͜ΕͰ΋μϝͳ͕࣌དྷͨΒߟ͑Δɻ ✖
  12. 17 dockerImageͷܰྔԽ 17  ΞϓϦέʔγϣϯίϯςφͷEPDLFS*NBHFʹը૾΋ؚ·Ε͍ͯΔɻ  EPDLFS*NBHF͸͍ܰʹͨ͜͠ࣄ͸ͳ͍ɻ  QVTI QVMM଎౓޲্σϓϩΠɺىಈ଎౓

    εέʔϧΞ΢τͷ൓ ө଎౓   ΞϓϦέʔγϣϯαʔόʔ഑Լʹͦ΋ͦ΋͍Δඞཁ͕ͳ͍ɻ  ը૾ϦιʔεΛ$MPVE'SPOU 4ʹϗεςΟϯάͯ͠ɺͦ΋ͦ΋ *NBHF͔Β֎͢ɻ
  13. 18 ϩάసૹΛίϯςφ੹຿͔ΒऔΓ֎͢ 18  DMPVE8BUDI ,JOFTJT'JSF)PSTF MBNCEB  1SPT 

    ίϯςφ͸ૹ৴Λߟ͑ͣඪ४ग़ྗʹు͚ͩ͘ͰΑ͘ͳΔ  ڞ༗ϘϦϡʔϜ͔Βͷղ์ɻ  ϩάૹ৴ͷؔ৺͝ͱमਖ਼Λίϯςφͷ੹຿͔ΒऔΓআ͚Δ  $POT  MBNCEB pSFIPSTFͷίετ͸૿͑Δ  ো֐఺ͷௐ͕ࠪ൥ࡶʹͳΒͳ͍͔ɺMBUFODZ໘ͳͲݕূத  GBSHBUFͷϩάυϥΠόʔʹqVFOU͕௥Ճ͞ΕΔͷͰɺෆཁʹͳΔ͔΋
  14. 19 ·ͱΊ 19  'BSHBUFͱίϯςφྑ͍΋ͷ  ΠϯϑϥೖΕସ͑࡞ۀͱΠϯελϯε؅ཧ͔Βͷղ์ɻ  Ϋϥελ؅ཧͱ޲͖߹Θͳ͍ͷͰΦʔτεέʔϧָɻ 

    &$4PO&$ͱൺ΂ͨݱ࣌఺Ͱͷػೳ໘ͷ੍໿ɺىಈ଎౓ɺՁ֨໘Ͱෆརͳࣄ͸ఱṝɻ  Ձ֨໘Ͱ͸΍͸Γ&$ΑΓ΍΍ׂߴɻ3*ʜ ŧŽ  ໾ׂผʹίϯςφʹ੾Γग़ͨ͠ࣄͰɺҰͭҰͭͷίϯςφʹର͢Δमਖ਼͸খ͘͞༰қʹͳͬͨɻ  ίϯςφۜͷ஄ؙͰ͸ͳ͍ɻ  ϝϦοτΛ׆͔ͤΔܗʹγεςϜͷߏ੒ΞϓϦέʔγϣϯΛม͍͑ͯ͘ඞཁ͸͋Δɻ  5XFMWF'BDUPS"QQ͸ྑ͍ࢦඪɻ ͍͖ͳΓશ෦͸ແཧͰ΋
  15. 20 WE ARE HIRING :) 20  ໌Δ͍৬৔Ͱ͢ɻ  ίϯςφԽʹݶΒͣϏδωεΛࢧ͑ɺՃ଎ͤ͞Δҝͷ৽͍͠௅ઓɺ౤ࢿ͸ৗʹܧଓͯ͠·͢

     ΧδϡΞϧ໘ஊ΋΍͍ͬͯ·͢ͷͰɺ͓ؾܰʹ   IUUQTXXXXBOUFEMZDPNDPNQBOJFTFVSFLB
  16. CONFIDENTIAL INFORMATION: Not for Public Distribution - Do Not Copy

    CONFIDENTIAL INFORMATION: Not for Public Distribution - Do Not Copy 5IBOLZPV