大規模ウェブサービスの成長に伴うデプロイ手法の変化から見る技術と文化 / openstackdays2018

大規模ウェブサービスの成長に伴うデプロイ手法の変化から見る技術と文化 / openstackdays2018

C84357a21083c81c5ccd5550422abc8d?s=128

Ryo Takaishi

August 02, 2018
Tweet

Transcript

  1. ∁ੴྒ / GMO Pepabo, Inc. 2018-08-02 OpenStackDays 2018 େن໛΢ΣϒαʔϏεͷ੒௕ʹ൐͏ σϓϩΠख๏ͷมԽ͔ΒݟΔٕज़ͱจԽ

  2. ∁ੴ ྒ / @r_takaishi https://repl.info/ TAKAISHI Ryo Ruby, Go OpenStack,

    Kubernetes
 Belgian beer
  3. 1. αʔϏεͷঢ়ଶʹԠͯ͡ɺద੾ͳٕज़Λબ୒͢Δ 2. γεςϜͷϨΠϠʔຖͷϥΠϑαΠΫϧΛҙࣝ͢ Δ͜ͱͰ։ൃΛߴ଎Խ 3. ϓϥοτϑΥʔϜͷಛੑΛཧղ͠ɺ௥ՃͰඞཁͳ ཁૉ͸࣮૷͢Δٕज़ !3 ࠓ೔࿩͢͜ͱ

  4. None
  5. None
  6. OpenStack

  7. OpenStack × =

  8. 2014-07ɹOpenStackݕ౼։࢝ 2015-05ɹHavanaελοΫӡ༻։࢝ 2016-08ɹ@r_takaishi ϖύϘೖࣾ 2017-01ɹMitakaελοΫӡ༻։࢝ 2018-08ɹHavana͔ΒMitaka΁ͷϚΠάϨʔγϣϯਐߦத ɹະདྷɹɹMitakaελοΫͷόʔδϣϯΞοϓɺHavanaελοΫͷୀ໾ɹɹɹ !8 /ZBIͷྺ࢙ w

    /FVUSPOʢ%)$1 - 'MPBUJOH*1ʣ w 0DUBWJB -#BB4  w $JOEFS 4DBMF*0  w *OGSBTUSVDUVSFBT$PEFXJUI5FSSBGPSN w :BP1SPEVDUT XSJUUFOCZ3VCZ
  9. ຊ୊

  10. ࠓ೔ͷςʔϚ

  11. σϓϩΠ

  12. σϓϩΠͱ͸ɺओʹωοτϫʔΫΛ ௨ͯ͡ఏڙ͞ΕΔ8FCΞϓϦέʔγϣ ϯͳͲͷγεςϜ։ൃ޻ఔʹ͓͍ͯɺ γεςϜΛར༻Մೳͳঢ়ଶʹ͢Δ͜ ͱͰ͋Δɻ *5༻ޠࣙయ8FCMJPࣙॻ

  13. !13 1.γεςϜΛར༻Մೳʹ͢Δ = Ϣʔβʔ͕ར༻Ͱ͖Δ 2.ߴ଎Ͱ҆ఆͨ͠σϓϩΠ => ϢʔβʔՁ஋޲্ 3.αʔϏεʹ͓͍ͯɺॏཁͳٕज़ͷҰͭ ͳͥσϓϩΠΛςʔϚͱͨ͠ͷ͔ʁ

  14.  ࠷దͳσϓϩΠٕज़͸αʔϏεͷ ن໛΍ঢ়ଶʹԠͯ͡มԽ͢Δ

  15. ࣮ྫ

  16. !16 • ϋϯυϝΠυϚʔέοτϓϥοτϑΥʔϜ • Web(Rails)ɾiOSɾAndroid • 7೥໨ NJOOF

  17. • PushܕΛ࠾༻ • σϓϩΠઌαʔόʔ΁ίʔυΛૹΓɺ੾Γସ͑Δ • Capistranoͱ͍͏Ruby੡ͷπʔϧΛ࢖༻ !17 ैདྷͷσϓϩΠख๏ ᶃΞϓϦͷίʔυΛऔಘϏϧυ ᶄ֤αʔόʔ΁44)ͰίʔυΛૹ৴


    ϓϩηε࠶ىಈ
  18. !18 • σϓϩΠઌαʔόʔ͕૿͑ͨͱ͖ʹ͕࣌ؒԆͼΔ • ͕͔͔࣌ؒΔ = τϥϒϧͷݩ • ͭ·Γ…੒௕ʹ൐͍αʔόʔ୆਺͕૿͖͑ͯͨͱ͖ ʹαʔϏεͷ੒௕Λ્֐͢ΔՄೳੑ͕͋Δ

    ैདྷͷख๏ʹ͓͚Δ՝୊
  19. αʔϏεͷ੒௕͕ ੒௕Λ્֐͢Δͷ͸ආ͚͍ͨ

  20. • PullܕσϓϩΠ΁Ҡߦ • ֤αʔόʔࣗ਎͕ίʔυΛऔಘ͠ɺ੾Γସ͑ʢfujiwara/stretcherʣ • Capistrano͔Βར༻͢ΔͨΊɺ଍Γͳ͍෦෼Λ௥Ճ࣮૷ !20 ɿ୆Ͱ΋σϓϩΠͰ͖ΔΑ͏ʹ͢Δͧʂʂʂ ᶃΞϓϦͷίʔυΛऔಘϏϧυ ᶆ֤αʔόʔ͕഑෍෺Λૹ৴


    ϓϩηε࠶ىಈ ᶄϏϧυࡁΈ഑෍෺Λ ετϨʔδʹอଘ ᶅσϓϩΠઌαʔόʔΫϥελ ʹରͯ͠σϓϩΠ໋ྩΛૹΔ
  21. !21 • αʔϏεͷن໛ɺঢ়ଶʹԠͯ͡ద੾ͳٕज़Λબ୒͢ Δ͜ͱͰ੒௕଎౓Λҡ࣋ɾՃ଎ͤ͞Δ • ଍Γͳ͍෦෼͸࣮૷࣮͠ݱ͢Δٕज़ɾͦΕΛਪ঑͢ ΔจԽ σϓϩΠํࣜͷ੾Γସ͔͑ΒΘ͔Δٕज़ɾจԽ

  22. ΞϓϦέʔγϣϯͷ࿩͸Θ͔ͬͨɻ ϛυϧ΢ΣΞͱ͔αʔόʔͷઃఆͱ ͔Ծ૝αʔόʔ͸ʁ

  23.  ϨΠϠʔຖͷϥΠϑαΠΫϧΛ ҙࣝ͠ɺޮ཰Α͘σϓϩΠ

  24. ࣮ྫ

  25. None
  26. !26 • ݚڀνʔϜͱͷίϥϘϨʔγϣϯ • ϩά͔ΒະདྷͷΞΫηεස౓Λ༧ଌͯ͠ࣄલʹ૿ݮ • ͦͷ࣌ʑͰΞΫηεΛॲཧͰ͖Δద੾ͳ୆਺΁ࣄલ ʹભҠ ɿΞΫηεස౓༧ଌΛ༻͍ͨαʔόʔ୆਺૿ݮ

  27. !27 ܭըతεέʔϦϯάͷߏ੒ ΞΫηεස౓༧ଌ ίϯϙʔωϯτ αʔόʔ୆਺ܭࢉɾ૿ݮ ίϯϙʔωϯτ ༧ଌ݁Ռอ࣋ ετϨʔδ IaaS Endpoint

    ೔ճɺ࣌ؒ୯ҐͰ
 ͦͷ೔ͷΞΫηεස౓Λ༧ଌ ࣌ؒʹճɺ࣍ͷ࣌ؒඞཁͳ αʔόʔ୆਺Λܭࢉɺ૿ݮ ࣍ͷ࣌ؒͷ ΞΫηεස౓༧ଌΛऔಘ αʔόʔ୆਺Λ૿ݮ ظ෼ͷ ΞΫηε༧ଌΛอଘ
  28. !28 ΞΫηεස౓ͱαʔόʔ୆਺ͷมԽ ܭըతεέʔϧɿແޮ ܭըతεέʔϧɿ༗ޮ

  29. ͏·͍͕ͬͨ͘ɺ՝୊΋͋ͬͨ

  30. αʔόʔΛ૿΍࣌͢ɺ αʔϏεΠϯ͕ؒʹ߹Θͳ͍͜ͱ͕

  31. αʔόʔىಈ͔Β αʔϏεΠϯ·ͰͷλΠϜϥά͕ ݪҼͷͭͩͬͨ

  32. ϥΠϑαΠΫϧͷҧ͍

  33. !33 γεςϜ಺ͷ֤ϨΠϠ͸ϥΠϑαΠΫϧ͕ͦΕͧΕҧ͏ ΞϓϦέʔγϣϯ ଟ͍ͱɺ೔ʹ਺ճʙ਺ेճೖΕସΘΔ ϛυϧ΢ΣΞ ΞϓϦέʔγϣϯΑΓ͸มߋස౓͸௿͍ αʔόʔ ΍Γํ࣍ୈ
 ΞϓϦέʔγϣϯɺϛυϧ΢ΣΞΑΓ͸௕͍͜ͱ͕ଟ͍

  34. !34 αʔόʔͷσϓϩΠαΠΫϧ www image v1 www image v2 www image

    v3 deleted www server v1 minne v1 www server v2 minne v1 www server v3 minne v1 deleted Golden Imageํࣜ w1VQQFUߋ৽࣌ʹΠϝʔδϏϧυ wϛυϧ΢ΣΞ(nginx, td-agent) wΞϓϦέʔγϣϯ(rails) wଈΞϓϦ͕ىಈ͢Δ deleted
  35. !35 αʔόʔͷσϓϩΠαΠΫϧ www image v1 deleted www image v2 www

    image v3 deleted www server v1 minne v1 www server v2 minne v1 www server v3 minne v1
  36. !36 αʔόʔͷσϓϩΠαΠΫϧ www image v1 deleted www image v2 www

    image v3 deleted www server v1 minne v1 www server v2 minne v1 www server v3 minne v1 Immutable Infrastructure
  37. !37 ΞϓϦέʔγϣϯͷσϓϩΠαΠΫϧ deploy minne-app v2 www image deleted www server

    minne v1 www server minne v2 www server minne v3 deploy minne-app v3 terminate server launch server
 & deploy latest minne
  38. !38 ΞϓϦͱͦΕҎ֎ͰσϓϩΠํࣜΛม͑ͯ੗Έ෼͚ ϛυϧ΢ΣΞ αʔόʔ ઃఆมߋ͕͋Ε͹ΰʔϧσϯΠϝʔδΛߋ৽ αʔόʔΛೖΕସ͑ͯ൓ө (Immutable Infrastructure) ΞϓϦέʔγϣϯ αʔόʔ಺ͷίʔυΛߋ৽


    αʔϏεΛ࠶ىಈͯ͠൓ө
 αʔόʔͷೖΕସ͑ෆཁͰߴ଎
  39. Ұݟ͏·͘Ͱ͖͍ͯΔ͕ʜʁ

  40. !40 σϓϩΠͷϥΠϑαΠΫϧ͕ҧ͏ͱԿ͕ى͖Δ͔ www image v1 www server v1 minne v1

    deploy minne-app v2 www server v1 minne v2
  41. !41 σϓϩΠͷϥΠϑαΠΫϧ͕ҧ͏ͱԿ͕ى͖Δ͔ www image v1 deleted www server v1 minne

    v1 www server v1 minne v1 deploy minne-app v2 www server v1 minne v2
  42. !42 σϓϩΠͷϥΠϑαΠΫϧ͕ҧ͏ͱԿ͕ى͖Δ͔ www image v1 www server v1 minne v1

    www server v1 minne v1 deploy minne-app v2 www server v1 minne v2 ΞϓϦͷόʔδϣϯ͕ҧ͏ʂ
  43. !43 σϓϩΠͷϥΠϑαΠΫϧ͕ҧ͏ͱԿ͕ى͖Δ͔ www image v1 deleted www server v1 minne

    v1 www server v1 minne v1 deploy minne-app v2 www server v1 minne v2 www server v1 minne v2 αʔϏεΠϯલʹΞϓϦΛ࠷৽൛ʹ
  44. !44 σϓϩΠͷϥΠϑαΠΫϧ͕ҧ͏ͱԿ͕ى͖Δ͔ www image v1 deleted www server v1 minne

    v1 www server v1 minne v1 deploy minne-app v2 www server v1 minne v2 www server v1 minne v2 αʔϏεΠϯલʹΞϓϦΛ࠷৽൛ʹ λΠϜϥά
  45. • αʔόʔىಈ࣌ʹ࠷৽ίʔυΛऔಘ͔ͯ͠ΒαʔϏεΠϯ • ίʔυऔಘ෼͚͕͔͔ͩ࣌ؒΔ • ૄ݁߹ԽΛਐΊ͖ͯͨͨΊʹൃੜ !45 ݪҼͷͭ

  46. • ΞϓϦσϓϩΠ࣌ʹϕʔεΠϝʔδΛϏϧυ͢Δ • Πϝʔδ͔Βىಈͨ࣌͠ɺৗʹ࠷৽ίʔυͰ্͕ͬͯ͘Δ • ΞϓϦͷσϓϩΠɺαʔόʔͷೖΕସ͑ͷͲͪΒʹ΋ӨڹΛ༩͑ͳ ͍✌ !46 γϯϓϧͳղܾํ๏

  47. !47 • ͏·͘γεςϜͷϨΠϠʔΛ෼͚Δ͜ͱͰɺͦΕͧ Ε͕࠷଎ͷํ๏ͰมߋΛՃ͑ଓ͚Δ͜ͱ͕Ͱ͖Δ • ͦΕͧΕͷ୲౰ϝϯόʔ͕ɺޓ͍ʹ࿈ܞ્ͭͭ͠֐ ͢Δ͜ͱͳ͘։ൃΛਐΊΔ͜ͱ͕Ͱ͖ΔจԽ ϨΠϠΛҙࣝͨ͠σϓϩΠ͔ΒΘ͔Δٕज़ͱจԽ

  48. ͋ΕʜΞϓϦͱΠϯϑϥΛ ͏·͘෼͚Δʜ Ͳ͔͜Ͱฉ͍ͨ͜ͱ͕͋Δ

  49. $BB41BB4͡ΌΜʂ

  50. ϓϥοτϑΥʔϜͷಛੑΛཧղ͠ɺ ଍Γͳ͍෦෼͸ඞཁͳΒ࣮૷͢Δ

  51. !51 • CaaSɿΞϓϦΛίϯςφͰϥοϓɺίϯςφҎԼ͸ ҙࣝෆཁ • PaaSɿΞϓϦέʔγϣϯ΍ϥϯλΠϜɺར༻Ϧιʔ εΛҙࣝ͢Ε͹Α͍ ૄ݁߹ҙࣝͨ͠Β$BB4΍1BB4ʹࣅ͖ͯͨ

  52. !52 αʔϏεͷ։ൃऀ͕ҙࣝ͢Δͷ͸Ͳͩ͜Ζ͏ʁ 7JSUVBM.BDIJOF 3VOUJNF "QQMJDBUJPO $POUBJOFS 7JSUVBM.BDIJOF 3VOUJNF "QQMJDBUJPO *BB4

    1BB4 3VOUJNF "QQMJDBUJPO $BB4 1BB4
  53. !53 • CaaS΍PaaSΛ࢖͑͹ɺ͜Ε·Ͱ࿩͖ͯͨ͜͠ͱ͸ ΍Βͳͯ͘Α͔ͬͨʁ • IaaS͔ΒCaaS/PaaSʹ৐Γ׵͑Δͷ͕ਖ਼ղͩͬͨʁ • ٕज़બ୒Λؒҧ͍͑ͯͨͷ͔ʁ ͱ͍͏͜ͱ͸ʜ

  54. 'ͦΜͳ͜ͱ͸ͳ͍

  55. !55 NJOOFϦϦʔε࣌఺Ͱ࢖͑ͨϓϥοτϑΥʔϜ͸ʁ 2006 2009 2013 minne
 release 2012/01 2015 PaaS

    heroku Container docker "84&$Ͱ։࢝ Ұ෦Λ/ZBI΁Ҡઃ IaaS AWS Private
 IaaS Nyah
  56. !56 • ϝϯόʔ͕ΞϓϦέʔγϣϯΤϯδχΞͷΈ • ϋʔυ΢ΣΞௐୡΛ଴ͨͳ͍ • AWSͷ஌ݟΛಘΔ ૉૣ͘࡞Γ࢝ΊΔͨΊͷબ୒ʢ೥ʙ೥ࠒʣ

  57. !57 • CaaS/PaaSʹ৐Γ׵͑Δ͜ͱ΋બ୒ࢶͷ1ͭ • ໨తΛୡ੒͢ΔͨΊʹࠓͱΕΔ࠷దղ͸Կ͔ʁ • ϓϥοτϑΥʔϜͷಛੑΛཧղ͢Δ • ଍Γͳ͍෦෼Λ࣮૷Ͱ͖Δٕज़ ॏཁͳͷ͸ඞཁʹԠͯ͡બ୒ɾ࣮૷Ͱ͖Δ͜ͱ

  58. ϓϥοτϑΥʔϜΛબͿͷ΋ ඞཁͳιϑτ΢ΣΞΛ࣮૷͢Δͷ΋ ʮٕज़ʯ

  59. 1. αʔϏεͷঢ়ଶʹԠͯ͡ɺద੾ͳٕज़Λબ୒͢Δ 2. γεςϜͷϨΠϠʔຖͷϥΠϑαΠΫϧΛҙࣝ͢ Δ͜ͱͰ։ൃΛߴ଎Խ 3. ϓϥοτϑΥʔϜͷಛੑΛཧղ͠ɺ௥ՃͰඞཁͳ ཁૉ͸࣮૷͢Δٕज़ !59 ࠓ೔࿩ͨ͜͠ͱ

  60. !60 • IaaS্Ͱޮ཰Α͘σϓϩΠ͢Δٕज़Λຏ͘ • ࠷ળͷબ୒͕Ͱ͖ΔΑ͏ʹ͢Δ • બ୒ࢶΛ૿΍͢ʢPrivate CaaSɺPrivate PaaSͱ͔ʣ •

    બ୒Ͱ͖Δٕज़ɺ஌ࣝΛ޿ΊΔ • ٕज़ͷมԽΛָ͠Ή ϖύϘ΋ΑΓΑ͍ͯͧ͘͘͠ʂ
  61. ΋ͬͱ͓΋͠Ζ͘Ͱ͖Δ 0QFO4UBDLɾ $MPVE/BUJWF͸

  62. We are hiring! Senior Software Engineer Software Engineer (Site Reliability)

    Senior Software Engineer (Site Reliability)