Cloud Foundryことはじめ

Cloud Foundryことはじめ

11/9に開催されたOSS User's Meetingの発表資料のリファインです

E6c98df4394e2863ab5de45e3be589de?s=128

Naoto TAKAHASHi

December 02, 2015
Tweet

Transcript

  1. Cloud Foundry ͜ͱ͸͡Ί ͔ͨ͸͠ͳ͓ͱ@tnaoto

  2. Who am I ? ͔ͨ͸͠ͳ͓ͱ Twitter: @tnaoto ೔ຊCloud Foundryάϧʔϓ؂ࣄ

  3. Attention ͜ͷࢿྉ͸ݸਓͷݟղͰ͋Γɺ
 ॴଐ͢Δ૊৫ͷެࣜݟղͰ͸ͳ͍΋ͷ͕
 ؚ·Ε·͢

  4. Cloud Foundryͷ࿩Λ͢Δલʹ PaaSͷ࿩

  5. PaaS Platform as a Service

  6. Ҿ༻ɿwikipedia PaaSͰ͸ɺιϑτ΢ΣΞΛߏங͓ΑͼՔಈͤ͞ΔͨΊͷ౔ ୆ͱͳΔϓϥοτϑΥʔϜΛɺΠϯλʔωοτܦ༝ͷαʔϏ εͱͯ͠ఏڙ͢Δɻ։ൃऀ͸ɺϓϥοτϑΥʔϜ্Ͱߏங͠ ͨαʔϏεΛࣗ෼ͷސ٬ʹఏڙ͢Δ͜ͱ͕Ͱ͖Δɻ ۩ମతʹ͸ɺΠϯϑϥɺDBMSɺϢʔβΠϯλϑΣʔεͳͲ ͷγεςϜ։ൃखஈͱͳΔπʔϧ΍ɺ։ൃͨ͠γεςϜΛӡ ༻͢ΔͨΊͷ؀ڥΛΠϯλʔωοτΛ௨ͯ͡ʮαʔϏεʯ ͱͯ͠ఏڙ͠ɺֹ݄࢖༻ྉͳͲͷܗͰऩೖΛಘΔࣄۀϞσϧ

  7. PaaS

  8. ࠓ೔͸ͦͷதͰ΋aPaaSͷ࿩

  9. aPaaS Application Platform as a Service

  10. aPaaS੡඼͸ɺΞϓϦέʔγϣϯɾαʔόɺ ΞϓϦέʔγϣϯ։ൃπʔϧɺߏ੒ɺϙʔλ ϧ͓ΑͼϢʔβʔརศੑɺΦʔέε τϨʔ γϣϯɺσʔλ؅ཧɺΞϓϦέʔγϣϯɾη ΩϡϦςΟͦͷଞͷΫϥ΢υɾαʔϏεΛू ໿ͨ͠΋ͷͰ͋Δ Ҿ༻ݩɿhttp://www.gartner.co.jp/b3i/research/120207_app/

  11. ͦ΋ͦ΋ͳͥPaaS͕ඞཁͳͷ͔

  12. ICTͷ໾ׂมԽ

  13. http://jp.fujitsu.com/group/fri/downloads/events/fri/for

  14. http://jp.fujitsu.com/group/fri/downloads/events/fri/for

  15. ޮ཰Խʢίετ࡟ݮʣΛ໨ࢦ͍ͯͨ͠ICT͸ ઓུతIT౤ࢿج൫ʹ଩Λ੾Γͭͭ͋Δ ͜ ͜ ॏ ཁ

  16. ઓུత౤ࢿ
 ࢼߦࡨޡɺ͔ͭɺεϐʔυউෛ ࢢ৔ͷεϐʔυ͕ૣ͘ͳΔͳ͔ɺ
 ग़དྷΔ͚ͩແବͳ͘ߦ͖͍ͨ

  17. ૉૣ͘ΞϓϦέʔγϣϯΛ࡞ͬͯ
 ΧελϚʔͷ൓ԠΛࢼ͍ͨ͠

  18. ͦ͜ͰPaaS͕ඞཁͱ͞ΕΔ
 ۩ମతͳ࿩͸ɺCloud FoundryͰྫͱ͠·͢

  19. ͱ͍͏͜ͱͰCloud Foundryͷ࿩ લஔ͖͕͍ͩͿ௕͘ͳΓ·ͨ͠….

  20. ͱ͍͏͜ͱͰɺCloud Foundry

  21. None
  22. Cloud Foundry Foundation

  23. Cloud Foundry͸Կ͕ग़དྷΔͷ͔ Ϋϥ΢υωΠςΟϒΞϓϦέʔγϣϯͷ
 ։ൃӡ༻͕ग़དྷΔ Ϋϥ΢υωΠςΟϒΞϓϦέʔγϣϯ?ʁʢɾωɾʆʣ

  24. Ϋϥ΢υωΠςΟϒΞϓϦέʔγϣϯ ڧ͍ܕܾΊ
 ։ൃऀ͸ΞϓϦέʔγϣϯͷ։ൃʹ͚ͩ஫ྗ OSɺϋʔυ͸ؾʹ͠ͳͯ͘ྑ͍ɺ
 ΋͘͠͸ɺؾʹ͢Δ͜ͱ͕ग़དྷͳ͍ ஫)ݸਓతओ؍Ͱ͢

  25. ΞϓϦέʔγϣϯฤ

  26. ݱঢ়֬ೝ

  27. ͝ଘ஌̏૚WebγεςϜ 8FCαʔό ΞϓϦέʔγϣϯαʔό σʔλϕʔε

  28. ࣮ମ͸͜Μͳײ͡ʁ 8FC 8FC "1 %# -# -# "1 "1

  29. ηοτΞοϓ 8FC 8FC "1 %# -# -# "1 "1 ϋʔυͳΒଟ෼ख࡞ۀ

    Ϛγϯ༻ҙͯ͠ɺ
 apacheೖΕͯɾɾɾ ϋʔυͳΒଟ෼ख࡞ۀ Ϛγϯ༻ҙͯ͠ɺϛυϧೖΕͯɺ
 ΞϓϦΛσϓϩΠͯ͠ɺ
 σʔλϕʔεͱͷ઀ଓΛઃఆͯ͠ɾɾ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ
 ςʔϒϧ࡞ͬͯɾɾɾ
  30. ηοτΞοϓ 8FC 8FC "1 %# -# -# "1 "1 ϋʔυͳΒଟ෼ख࡞ۀ

    Ϛγϯ༻ҙͯ͠ɺ
 apacheೖΕͯɾɾɾ ϋʔυͳΒଟ෼ख࡞ۀ Ϛγϯ༻ҙͯ͠ɺϛυϧೖ ΞϓϦΛσϓϩΠͯ͠ɺ
 σʔλϕʔεͱͷ઀ଓΛઃ Ϛγϯ༻ҙͯ͠ɺDBೖΕ ςʔϒϧ࡞ͬͯɾɾɾ
  31. Cloud Foundry 8FC 8FC "1 %# -# -# "1 "1

    }Cloud Foundry͕༻ҙ ϛυϧ͸Cloud Foundry͕༻ҙ
 ΞϓϦͷσϓϩΠʗೖΕସ͑ͷΈ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ
 ςʔϒϧ࡞ͬͯɾɾɾ
 ͜͜͸ͦΜͳʹมΘΒͳ͍
  32. ηοτΞοϓ͸chef͕shell͔ 8FC 8FC "1 %# -# -# "1 "1 }

    Cloud Foundry͕༻ҙ ϛυϧ͸Cloud Foundry͕༻ҙ
 ΞϓϦͷσϓϩΠʗೖΕସ͑ͷΈ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ
 ςʔϒϧ࡞ͬͯɾɾɾ
 ͜͜͸ͦΜͳʹมΘΒͳ͍
  33. deploy cf push sampleapps

  34. σʔλϕʔεͱͷ઀ଓ cf create-service <database>
 cf bind-service <databese> Ҿ਺͸؆ུԽ͍ͯ͠·͢

  35. Operations 8FC 8FC "1 %# -# -# "1 "1 }

    Cloud Foundry͕༻ҙ cf push cf bind-service cf create-service
  36. Process 8FC 8FC "1 %# -# -# "1 "1 }

    Cloud Foundry͕༻ҙ cf push –i <num> cf scale–i <num>
  37. Αʔ͠ɺ ࠓͷΞϓϦέʔγϣϯͥΜͿࡌͤସ͑ͪΌ͑

  38. ͪΐͬͱ଴ͬͨ

  39. Cloud FoundryͰѻ͑ΔΞϓϦέʔγϣϯ Ϋϥ΢υωΠςΟϒΞϓϦέʔγϣϯ ΋ʹΎʁʢɾωɾʆʣ

  40. ۩ମతʹ͸ʁ The Twelve-factor appʹैͬͨWebΞϓϦ ͸ͯʁʢɾωɾʆʣ

  41. The twelve-factor app I. ίʔυϕʔε (Codebase)
 όʔδϣϯ؅ཧ͞Ε͍ͯΔ1ͭͷίʔυϕʔεͱ
 ෳ਺ͷσϓϩΠ II. ґଘؔ܎

    (Dependencies)
 ґଘؔ܎Λ໌ࣔతʹએݴ͠෼཭͢Δ III. ઃఆ (Config)
 ઃఆΛ؀ڥม਺ʹ֨ೲ͢Δ IV. όοΫΤϯυαʔϏε (Backing Services)
 όοΫΤϯυαʔϏεΛΞλον͞ΕͨϦιʔεͱͯ͠ѻ͏ V. ϏϧυɺϦϦʔεɺ࣮ߦ (Build, release, run)
 ϏϧυɺϦϦʔεɺ࣮ߦͷ3ͭͷεςʔδΛݫີʹ෼཭͢Δ VI. ϓϩηε (Processes)
 ΞϓϦέʔγϣϯΛ1ͭ΋͘͠͸ෳ਺ͷεςʔτϨεͳϓϩ VII. ϙʔτόΠϯσΟϯά (Port binding)
 ϙʔτόΠϯσΟϯάΛ௨ͯ͠αʔϏεΛެ։͢Δ VIII. ฒߦੑ (Concurrency)
 ϓϩηεϞσϧʹΑͬͯεέʔϧΞ΢τ͢Δ IX. ഇغ༰қੑ (Disposability)
 ߴ଎ͳىಈͱάϨʔεϑϧγϟοτμ΢ϯͰݎ࿚ੑΛ࠷େԽ ͢Δ X. ։ൃ/ຊ൪Ұக (Dev/prod parity)
 ։ൃɺεςʔδϯάɺຊ൪؀ڥΛͰ͖Δ͚ͩҰகͤͨ͞ঢ়ଶ Λอͭ XI. ϩά (Logs)
 ϩάΛΠϕϯτετϦʔϜͱͯ͠ѻ͏ XII. ؅ཧϓϩηε (Admin processes)
 ؅ཧλεΫΛ1ճݶΓͷϓϩηεͱ࣮ͯ͠ߦ͢Δ
  42. ৄࡉ͸͜ͷ͋ͨΓͰ ೔ܦίϯϐϡʔλ 2015 9/18 ߸ ೔ܦITPro http://itpro.nikkeibp.co.jp/atcl/column/14/110900092/ 12ݸͷϓϥΫςΟεΛ̏ͭʹ෼ྨ
 ΤϯλʔϓϥΠζ͸Ͳ͏͢Δ΂͖͔ΛɺΦϦδφϧͷղऍͱڞʹड़΂ͨ •

    ΞϓϦέʔγϣϯͷਝ଎ͳվम • ؀ڥ΁ͷਝ଎ͳల։ • Ϧιʔε૿ݮ΍ӡ༻؅ཧΛ༰қʹ͢Δ
  43. The Twelve-factor appʹैͬͨWebΞϓϦ Cloud Foundry΋શ෦͸ରԠͯ͠ͳ͍ CF FoundationͷCTO͸11ݸ͸ ରԠͯ͠Δͬͯݴͬͯͨʢɾωɾʆʣ

  44. The twelve-factor app I. ίʔυϕʔε (Codebase)
 όʔδϣϯ؅ཧ͞Ε͍ͯΔ1ͭͷίʔυϕʔεͱ
 ෳ਺ͷσϓϩΠ II. ґଘؔ܎

    (Dependencies)
 ґଘؔ܎Λ໌ࣔతʹએݴ͠෼཭͢Δ III. ઃఆ (Config)
 ઃఆΛ؀ڥม਺ʹ֨ೲ͢Δ IV. όοΫΤϯυαʔϏε (Backing Services)
 όοΫΤϯυαʔϏεΛΞλον͞ΕͨϦιʔεͱͯ͠ѻ͏ V. ϏϧυɺϦϦʔεɺ࣮ߦ (Build, release, run)
 ϏϧυɺϦϦʔεɺ࣮ߦͷ3ͭͷεςʔδΛݫີʹ෼཭͢Δ VI. ϓϩηε (Processes)
 ΞϓϦέʔγϣϯΛ1ͭ΋͘͠͸ෳ਺ͷεςʔτϨεͳϓϩ ηεͱ࣮ͯ͠ߦ͢Δ VII. ϙʔτόΠϯσΟϯά (Port binding)
 ϙʔτόΠϯσΟϯάΛ௨ͯ͠αʔϏεΛެ։͢Δ VIII. ฒߦੑ (Concurrency)
 ϓϩηεϞσϧʹΑͬͯεέʔϧΞ΢τ͢Δ IX. ഇغ༰қੑ (Disposability)
 ߴ଎ͳىಈͱάϨʔεϑϧγϟοτμ΢ϯͰݎ࿚ੑΛ࠷େԽ ͢Δ X. ։ൃ/ຊ൪Ұக (Dev/prod parity)
 ։ൃɺεςʔδϯάɺຊ൪؀ڥΛͰ͖Δ͚ͩҰகͤͨ͞ঢ়ଶ Λอͭ XI. ϩά (Logs)
 ϩάΛΠϕϯτετϦʔϜͱͯ͠ѻ͏ XII. ؅ཧϓϩηε (Admin processes)
 ؅ཧλεΫΛ1ճݶΓͷϓϩηεͱ࣮ͯ͠ߦ͢Δ
  45. ͲΜͳΞϓϦέʔγϣϯ͕
 Cloud Foundryͷ্Ͱಈ࡞͢Δͷ͔ɺ
 ͦͷݕূ֬ೝΛίϛϡχςΟͰ࣮ࢪத http://blog.cloudfoundry.gr.jp/

  46. ͜ΜͳΞϓϦ͸ಈ͔ͳ͍ ϓϥοτϑΥʔϜΛҙࣝͨ͠ΞϓϦ

  47. ϓϥοτϑΥʔϜΛҙࣝͨ͠ΞϓϦ ྫ͑͹WindowsͰ͔͠ಈ͔ͳ͍Java ιʔεͷதͰɺC:¥ͷϑΝΠϧΛಡΈࠐΉͱ͔ॻ͍ͯ͋ΔΑ͏ͳ΍ͭ

  48. ࠓͷΞϓϦ͸௚ͤͳ͍

  49. ࠓͷΞϓϦέʔγϣϯΛ௚͢ΑΓɺ ৽͍͠ϏδωεͷͨΊͷΞϓϦέʔγϣϯΛ ͜ΕͰॻ͍͍͚ͯ͹͍͍

  50. Buildpacks Cloud Foundry͕ඪ४Ͱѻ͑Δݴޠ(buildpack) ruby(rack,sinatora,rails) java(tomcat) python(Django) staticfile gokang php nodejs

  51. ϓϥοτϑΥʔϜͷ֦ுੑ buildpackͷ௥Ճ࡞੒ɺվ଄ʹΑΓಈ͔ͤΔ ΞϓϦέʔγϣϯͷ෯͸޿͛ΒΕΔ

  52. buildpackͷ࿩͸ɺ͜ͷลʹ http://www.slideshare.net/jacopen/cf-buildpack

  53. Πϯϑϥฤ

  54. Cloud FoundryͬͯͲ͏ಈ͍͍ͯΔͷ͔ Clod Foundryͷத਎ͬͯʁ Cloud Foundry͸Ͳ͜Ͱಈ͘ͷ͔

  55. Cloud FoundryΛࢧ͑Δओͳίϯϙʔωϯτ Router Authentication Cloud Controller HM9000 Application Execution Blog

    Store Service Brokers Message Bus Logging and Statistics
  56. 3PVUFS .FTTBHF#VT $MPVE $POUSPMMFS %&" "VUIFOUJDBUJPO #MPCTUPSF 4FSWJDF#SPLFS -PHBOE 4UBUJDT

    .) ͢΂ͯͷ௨৴ʹհࡏ
  57. Router ϦϙδτϦ໊শɿgorouter
 https://github.com/cloudfoundry/gorouter L4ϧʔλͰ͸ͳ͘ L7ΞϓϦέʔγϣϯϧʔλ 3PVUFS %&" %&" %&" ϧʔλ͕DEA΁ͷΞΫηεΛ੍ޚ͢Δ


    LBͰ͸ͳ͍ͷͰෛՙ෼ࢄͰ͸ͳ͍
  58. Authentication ϦϙδτϦ໊শɿuaa
 https://github.com/cloudfoundry/uaa ೝূճΓ͢΂ͯΛ؅ཧ །Ұͷjava࣮૷

  59. Cloud Controller ϦϙδτϦ໊শɿcloud_controller_ng
 ௨শɿCC
 https://github.com/cloudfoundry/cloud_controller_ng 3PVUFS $$ %&" %&" ϧʔλ͸ΞϓϦέʔγϣϯͱڞ༗


    ੍ޚ༻ͷಛผϧʔτΛܦ༝ Cloud Foundryͷ৺ଁ෦
 CC͸ɺAPIαʔόͱͯ͠ػೳ͠
 γεςϜશମͷ൑அɾ੍ޚΛߦ͏
  60. HM9000 ϦϙδτϦ໊শɿhm9000
 ௨শɿHealth Manager
 https://github.com/cloudfoundry/hm9000 $$ %&" %&" ͋͘·ͰΞϓϦέʔγϣϯͷ؂ࢹͰ͋Γɺ
 Cloud

    Foundryͷίϯϙʔωϯτͷ؂ࢹ͸͠ͳ͍ ΞϓϦέʔγϣϯͷࢮ׆؂ࢹ
 DEA্Ͱ࣮ߦ͍ͯ͠ΔΞϓϦέʔγϣϯͷࢮ׆؂ࢹΛߦ͍ɺ ࢦఆ͞Εͨϓϩηε਺ʹ߹Θͳ͚Ε͹ɺ ىಈʗఀࢭΛߦ͏ࢦࣔΛCCʹରͯ͠ૹ৴͢Δ ). ࢦࣔ ௥Ճʗ࡟আ ؂ࢹ
  61. Application Execution ϦϙδτϦ໊শɿdea_ng
 ௨শɿdea(Droplet Execution Agent)
 https://github.com/cloudfoundry/dea_ng ΞϓϦέʔγϣϯ͸
 wardenίϯςφʹΑִͬ͑཭ɾӡ༻͞ΕΔ ΞϓϦέʔγϣϯ࣮ߦ؅ཧ


    ΞϓϦέʔγϣϯ͕࣮ߦ͞ΕΔͨΊͷϗετػೳΛఏڙ
 ɾΞϓϦέʔγϣϯϏϧυ
 ɾΞϓϦέʔγϣϯ࣮ߦ؅ཧ XBSEFO XBSEFO dea warden
 Linuxίϯςφٕज़Λϕʔεʹ
 Cloud Foundry্ͰΞϓϦέʔγϣϯΛ
 ࣮ߦ͢ΔͨΊʹඞཁ࠷௿ػೳͷΈ࣮૷
  62. Blob Store ࣮ମ͸ɺCloud Controllerͷதͷػೳ Dropletͷ࡞੒΋wardenΛར༻ DEAͰ࡞੒͞Εͨdropletͷ؅ཧอଘΛߦ͏
 DEA্Ͱ࡞੒͞ΕͨDroplet͸ɺCC্ʹอଘ͞Ε
 ඞཁʹԠ͡ͰDEAʹμ΢ϯϩʔυ͞Ε࣮ߦ͞ΕΔ XBSEFO XBSEFO

    dea XBSEFO XBSEFO dea $$ shred
  63. Service Brokers ࣮ମ͸ɺCloud ControllerͷதͷػೳͱαʔϏεଆͷBrokerͷػೳ XBSEFO XBSEFO dea NZTRM QPTUHSFT $$

    shred αʔϏεͷ࡞੒ɾ࡟আ
 ͓ΑͼɺΞϓϦέʔγϣϯͱͷόΠϯυʗΞϯόΠϯυΛߦ͏ 4FSWJDF#SPLFS SFEJT
  64. Message Bus ϦϙδτϦ໊শɿgnats
 ௨শɿnats
 https://github.com/nats-io/gnats ΞϓϦέʔγϣϯ͸
 wardenίϯςφʹΑִͬ͑཭ɾӡ༻͞ΕΔ ίϯϙʔωϯτؒ௨৴ XBSEFO XBSEFO

    dea warden
 Linuxίϯςφٕज़Λϕʔεʹ
 Cloud Foundry্ͰΞϓϦέʔγϣϯΛ
 ࣮ߦ͢ΔͨΊʹඞཁ࠷௿ػೳͷΈ࣮૷
  65. Logging and Statics ϦϙδτϦ໊শɿloggregator
 https://github.com/cloudfoundry/loggregator ϩΪϯά
 Cloud FoundryͷίϯϙʔωϯτʗΞϓϦέʔγϣϯͷϩάΛऩू͢Δ

  66. Cloud Foundryͬͯ Ͳ͏ಈ͍͍ͯΔͷ͔

  67. Cloud Foundry͸ϚϧνIaaSରԠ

  68. Cloud Foundry͸ ͘͝Ұൠతͳ͝Ոఉʹ͋Δ OpenStackͷ্Ͱಈ͖·͢

  69. ҰൠՈఉ֎ͷํ޲͚ bosh-lite nise_bosh_installer

  70. Cloud Foundryͷಈ޲

  71. ←ग़ͯ͜ͳ͍ͳʔͱࢥͬͯ·ͨ͠ʁ

  72. Diego ࠷ۙΞʔΩςΫνϟ

  73. https://github.com/cloudfoundry-incubator/diego-design-notes

  74. Diego DockerରԠ ↓ ਖ਼͘͠͸ɺDocker ImageରԠ
 DockeΤϯδϯ͸ະ࢖༻
 Dockerfileɾࠩ෼ϑΝΠϧγεςϜ΋࢖Θͳ͍

  75. Warden(͏͒ʔͲΜʣ Cloud Foundryʹ͸ɺ
 ͢Ͱʹಠࣗίϯςφ͕ͷ࣮૷͞Ε͍ͯΔ Garden ಺෦తʹ࣮૷͕มΘΔ
 Linux/WindowsʹରԠ

  76. Garden Linux/Windows
 ͲͪΒ΋dockerΠϝʔδΛ
 ৯͑ΔΑ͏ʹͳͬͯಈ͘͸ͣɾɾɾ چདྷͷΞϓϦ͸LinuxଆͰରԠ

  77. ࡉ͔͍࿩͸͜ͷ͋ͨΓͰɻ http://www.slideshare.net/jacopen/diego-45603123