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
Cloud Foundryことはじめ
Search
Naoto TAKAHASHi
December 02, 2015
Technology
1
910
Cloud Foundryことはじめ
11/9に開催されたOSS User's Meetingの発表資料のリファインです
Naoto TAKAHASHi
December 02, 2015
Tweet
Share
More Decks by Naoto TAKAHASHi
See All by Naoto TAKAHASHi
OneOps
tnaoto
0
640
tsuru
tnaoto
0
2k
FUJITSU-meets-CloudFoundry
tnaoto
10
3.7k
Other Decks in Technology
See All in Technology
AIのコンプラは何故しんどい?
shujisado
1
110
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
110
2000年てづくりキーボードの旅
tagomoris
1
170
新機能Amazon GuardDuty Extended Threat Detectionはネ申って話
cmusudakeisuke
0
350
re:Inventで発表された Bedrockの新機能を色々使って、マルチRAGエージェントにクラウド選定させてみた件
minorun365
PRO
4
280
データパイプラインをなんとかした話 / Improving the Data Pipeline in IVRy
mirakui
1
290
PR TIMESにおけるNext.jsとcacheの付き合い方
apple_yagi
3
330
運用者が見るべき、ダッシュボードと問題の把握
masaaki_k
0
110
権威ドキュメントで振り返る2024 #年忘れセキュリティ2024
hirotomotaguchi
2
380
宇宙最速のランチRecap LT会(AWS re:Invent 2024)
watany
1
420
密着! Bedrockerがre:Invent 2024で過ごした5日間を紹介
minorun365
PRO
3
360
AWS re:Invent 2024 re:Cap CloudFront編
yoshimi0227
0
230
Featured
See All Featured
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
126
18k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Agile that works and the tools we love
rasmusluckow
328
21k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
500
Dealing with People You Can't Stand - Big Design 2015
cassininazir
365
25k
Fireside Chat
paigeccino
34
3.1k
Making the Leap to Tech Lead
cromwellryan
133
9k
The Language of Interfaces
destraynor
154
24k
How to Ace a Technical Interview
jacobian
276
23k
Transcript
Cloud Foundry ͜ͱ͡Ί ͔ͨ͠ͳ͓ͱ@tnaoto
Who am I ? ͔ͨ͠ͳ͓ͱ Twitter: @tnaoto ຊCloud Foundryάϧʔϓࣄ
Attention ͜ͷࢿྉݸਓͷݟղͰ͋Γɺ ॴଐ͢Δ৫ͷެࣜݟղͰͳ͍ͷ͕ ؚ·Ε·͢
Cloud FoundryͷΛ͢Δલʹ PaaSͷ
PaaS Platform as a Service
Ҿ༻ɿwikipedia PaaSͰɺιϑτΣΞΛߏங͓ΑͼՔಈͤ͞ΔͨΊͷ ͱͳΔϓϥοτϑΥʔϜΛɺΠϯλʔωοτܦ༝ͷαʔϏ εͱͯ͠ఏڙ͢Δɻ։ൃऀɺϓϥοτϑΥʔϜ্Ͱߏங͠ ͨαʔϏεΛࣗͷސ٬ʹఏڙ͢Δ͜ͱ͕Ͱ͖Δɻ ۩ମతʹɺΠϯϑϥɺDBMSɺϢʔβΠϯλϑΣʔεͳͲ ͷγεςϜ։ൃखஈͱͳΔπʔϧɺ։ൃͨ͠γεςϜΛӡ ༻͢ΔͨΊͷڥΛΠϯλʔωοτΛ௨ͯ͡ʮαʔϏεʯ ͱͯ͠ఏڙ͠ɺֹ݄༻ྉͳͲͷܗͰऩೖΛಘΔࣄۀϞσϧ
PaaS
ࠓͦͷதͰaPaaSͷ
aPaaS Application Platform as a Service
aPaaSɺΞϓϦέʔγϣϯɾαʔόɺ ΞϓϦέʔγϣϯ։ൃπʔϧɺߏɺϙʔλ ϧ͓ΑͼϢʔβʔརศੑɺΦʔέε τϨʔ γϣϯɺσʔλཧɺΞϓϦέʔγϣϯɾη ΩϡϦςΟͦͷଞͷΫϥυɾαʔϏεΛू ͨ͠ͷͰ͋Δ Ҿ༻ݩɿhttp://www.gartner.co.jp/b3i/research/120207_app/
ͦͦͳͥPaaS͕ඞཁͳͷ͔
ICTͷׂมԽ
http://jp.fujitsu.com/group/fri/downloads/events/fri/for
http://jp.fujitsu.com/group/fri/downloads/events/fri/for
ޮԽʢίετݮʣΛࢦ͍ͯͨ͠ICT ઓུతITࢿج൫ʹΛΓͭͭ͋Δ ͜ ͜ ॏ ཁ
ઓུతࢿ ࢼߦࡨޡɺ͔ͭɺεϐʔυউෛ ࢢͷεϐʔυ͕ૣ͘ͳΔͳ͔ɺ ग़དྷΔ͚ͩແବͳ͘ߦ͖͍ͨ
ૉૣ͘ΞϓϦέʔγϣϯΛ࡞ͬͯ ΧελϚʔͷԠΛࢼ͍ͨ͠
ͦ͜ͰPaaS͕ඞཁͱ͞ΕΔ ۩ମతͳɺCloud FoundryͰྫͱ͠·͢
ͱ͍͏͜ͱͰCloud Foundryͷ લஔ͖͕͍ͩͿ͘ͳΓ·ͨ͠….
ͱ͍͏͜ͱͰɺCloud Foundry
None
Cloud Foundry Foundation
Cloud FoundryԿ͕ग़དྷΔͷ͔ ΫϥυωΠςΟϒΞϓϦέʔγϣϯͷ ։ൃӡ༻͕ग़དྷΔ ΫϥυωΠςΟϒΞϓϦέʔγϣϯ?ʁʢɾωɾʆʣ
ΫϥυωΠςΟϒΞϓϦέʔγϣϯ ڧ͍ܕܾΊ ։ൃऀΞϓϦέʔγϣϯͷ։ൃʹ͚ͩྗ OSɺϋʔυؾʹ͠ͳͯ͘ྑ͍ɺ ͘͠ɺؾʹ͢Δ͜ͱ͕ग़དྷͳ͍ )ݸਓతओ؍Ͱ͢
ΞϓϦέʔγϣϯฤ
ݱঢ়֬ೝ
͝ଘ̏WebγεςϜ 8FCαʔό ΞϓϦέʔγϣϯαʔό σʔλϕʔε
࣮ମ͜Μͳײ͡ʁ 8FC 8FC "1 %# -# -# "1 "1
ηοτΞοϓ 8FC 8FC "1 %# -# -# "1 "1 ϋʔυͳΒଟख࡞ۀ
Ϛγϯ༻ҙͯ͠ɺ apacheೖΕͯɾɾɾ ϋʔυͳΒଟख࡞ۀ Ϛγϯ༻ҙͯ͠ɺϛυϧೖΕͯɺ ΞϓϦΛσϓϩΠͯ͠ɺ σʔλϕʔεͱͷଓΛઃఆͯ͠ɾɾ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ ςʔϒϧ࡞ͬͯɾɾɾ
ηοτΞοϓ 8FC 8FC "1 %# -# -# "1 "1 ϋʔυͳΒଟख࡞ۀ
Ϛγϯ༻ҙͯ͠ɺ apacheೖΕͯɾɾɾ ϋʔυͳΒଟख࡞ۀ Ϛγϯ༻ҙͯ͠ɺϛυϧೖ ΞϓϦΛσϓϩΠͯ͠ɺ σʔλϕʔεͱͷଓΛઃ Ϛγϯ༻ҙͯ͠ɺDBೖΕ ςʔϒϧ࡞ͬͯɾɾɾ
Cloud Foundry 8FC 8FC "1 %# -# -# "1 "1
}Cloud Foundry͕༻ҙ ϛυϧCloud Foundry͕༻ҙ ΞϓϦͷσϓϩΠʗೖΕସ͑ͷΈ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ ςʔϒϧ࡞ͬͯɾɾɾ ͦ͜͜ΜͳʹมΘΒͳ͍
ηοτΞοϓchef͕shell͔ 8FC 8FC "1 %# -# -# "1 "1 }
Cloud Foundry͕༻ҙ ϛυϧCloud Foundry͕༻ҙ ΞϓϦͷσϓϩΠʗೖΕସ͑ͷΈ Ϛγϯ༻ҙͯ͠ɺDBೖΕͯɺ ςʔϒϧ࡞ͬͯɾɾɾ ͦ͜͜ΜͳʹมΘΒͳ͍
deploy cf push sampleapps
σʔλϕʔεͱͷଓ cf create-service <database> cf bind-service <databese> Ҿ؆ུԽ͍ͯ͠·͢
Operations 8FC 8FC "1 %# -# -# "1 "1 }
Cloud Foundry͕༻ҙ cf push cf bind-service cf create-service
Process 8FC 8FC "1 %# -# -# "1 "1 }
Cloud Foundry͕༻ҙ cf push –i <num> cf scale–i <num>
Αʔ͠ɺ ࠓͷΞϓϦέʔγϣϯͥΜͿࡌͤସ͑ͪΌ͑
ͪΐͬͱͬͨ
Cloud FoundryͰѻ͑ΔΞϓϦέʔγϣϯ ΫϥυωΠςΟϒΞϓϦέʔγϣϯ ʹΎʁʢɾωɾʆʣ
۩ମతʹʁ The Twelve-factor appʹैͬͨWebΞϓϦ ͯʁʢɾωɾʆʣ
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ճݶΓͷϓϩηεͱ࣮ͯ͠ߦ͢Δ
ৄࡉ͜ͷ͋ͨΓͰ ܦίϯϐϡʔλ 2015 9/18 ߸ ܦITPro http://itpro.nikkeibp.co.jp/atcl/column/14/110900092/ 12ݸͷϓϥΫςΟεΛ̏ͭʹྨ ΤϯλʔϓϥΠζͲ͏͢Δ͖͔ΛɺΦϦδφϧͷղऍͱڞʹड़ͨ •
ΞϓϦέʔγϣϯͷਝͳվम • ڥͷਝͳల։ • Ϧιʔε૿ݮӡ༻ཧΛ༰қʹ͢Δ
The Twelve-factor appʹैͬͨWebΞϓϦ Cloud Foundryશ෦ରԠͯ͠ͳ͍ CF FoundationͷCTO11ݸ ରԠͯ͠Δͬͯݴͬͯͨʢɾωɾʆʣ
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ճݶΓͷϓϩηεͱ࣮ͯ͠ߦ͢Δ
ͲΜͳΞϓϦέʔγϣϯ͕ Cloud Foundryͷ্Ͱಈ࡞͢Δͷ͔ɺ ͦͷݕূ֬ೝΛίϛϡχςΟͰ࣮ࢪத http://blog.cloudfoundry.gr.jp/
͜ΜͳΞϓϦಈ͔ͳ͍ ϓϥοτϑΥʔϜΛҙࣝͨ͠ΞϓϦ
ϓϥοτϑΥʔϜΛҙࣝͨ͠ΞϓϦ ྫ͑WindowsͰ͔͠ಈ͔ͳ͍Java ιʔεͷதͰɺC:¥ͷϑΝΠϧΛಡΈࠐΉͱ͔ॻ͍ͯ͋ΔΑ͏ͳͭ
ࠓͷΞϓϦͤͳ͍
ࠓͷΞϓϦέʔγϣϯΛ͢ΑΓɺ ৽͍͠ϏδωεͷͨΊͷΞϓϦέʔγϣϯΛ ͜ΕͰॻ͍͍͚͍͍ͯ
Buildpacks Cloud Foundry͕ඪ४Ͱѻ͑Δݴޠ(buildpack) ruby(rack,sinatora,rails) java(tomcat) python(Django) staticfile gokang php nodejs
ϓϥοτϑΥʔϜͷ֦ுੑ buildpackͷՃ࡞ɺվʹΑΓಈ͔ͤΔ ΞϓϦέʔγϣϯͷ෯͛ΒΕΔ
buildpackͷɺ͜ͷลʹ http://www.slideshare.net/jacopen/cf-buildpack
Πϯϑϥฤ
Cloud FoundryͬͯͲ͏ಈ͍͍ͯΔͷ͔ Clod Foundryͷதͬͯʁ Cloud FoundryͲ͜Ͱಈ͘ͷ͔
Cloud FoundryΛࢧ͑Δओͳίϯϙʔωϯτ Router Authentication Cloud Controller HM9000 Application Execution Blog
Store Service Brokers Message Bus Logging and Statistics
3PVUFS .FTTBHF#VT $MPVE $POUSPMMFS %&" "VUIFOUJDBUJPO #MPCTUPSF 4FSWJDF#SPLFS -PHBOE 4UBUJDT
.) ͯ͢ͷ௨৴ʹհࡏ
Router ϦϙδτϦ໊শɿgorouter https://github.com/cloudfoundry/gorouter L4ϧʔλͰͳ͘ L7ΞϓϦέʔγϣϯϧʔλ 3PVUFS %&" %&" %&" ϧʔλ͕DEAͷΞΫηεΛ੍ޚ͢Δ
LBͰͳ͍ͷͰෛՙࢄͰͳ͍
Authentication ϦϙδτϦ໊শɿuaa https://github.com/cloudfoundry/uaa ೝূճΓͯ͢Λཧ །Ұͷjava࣮
Cloud Controller ϦϙδτϦ໊শɿcloud_controller_ng ௨শɿCC https://github.com/cloudfoundry/cloud_controller_ng 3PVUFS $$ %&" %&" ϧʔλΞϓϦέʔγϣϯͱڞ༗
੍ޚ༻ͷಛผϧʔτΛܦ༝ Cloud Foundryͷ৺ଁ෦ CCɺAPIαʔόͱͯ͠ػೳ͠ γεςϜશମͷஅɾ੍ޚΛߦ͏
HM9000 ϦϙδτϦ໊শɿhm9000 ௨শɿHealth Manager https://github.com/cloudfoundry/hm9000 $$ %&" %&" ͋͘·ͰΞϓϦέʔγϣϯͷࢹͰ͋Γɺ Cloud
Foundryͷίϯϙʔωϯτͷࢹ͠ͳ͍ ΞϓϦέʔγϣϯͷࢮ׆ࢹ DEA্Ͱ࣮ߦ͍ͯ͠ΔΞϓϦέʔγϣϯͷࢮ׆ࢹΛߦ͍ɺ ࢦఆ͞Εͨϓϩηεʹ߹Θͳ͚Εɺ ىಈʗఀࢭΛߦ͏ࢦࣔΛCCʹରͯ͠ૹ৴͢Δ ). ࢦࣔ Ճʗআ ࢹ
Application Execution ϦϙδτϦ໊শɿdea_ng ௨শɿdea(Droplet Execution Agent) https://github.com/cloudfoundry/dea_ng ΞϓϦέʔγϣϯ wardenίϯςφʹΑִͬ͑ɾӡ༻͞ΕΔ ΞϓϦέʔγϣϯ࣮ߦཧ
ΞϓϦέʔγϣϯ͕࣮ߦ͞ΕΔͨΊͷϗετػೳΛఏڙ ɾΞϓϦέʔγϣϯϏϧυ ɾΞϓϦέʔγϣϯ࣮ߦཧ XBSEFO XBSEFO dea warden Linuxίϯςφٕज़Λϕʔεʹ Cloud Foundry্ͰΞϓϦέʔγϣϯΛ ࣮ߦ͢ΔͨΊʹඞཁ࠷ػೳͷΈ࣮
Blob Store ࣮ମɺCloud Controllerͷதͷػೳ Dropletͷ࡞wardenΛར༻ DEAͰ࡞͞ΕͨdropletͷཧอଘΛߦ͏ DEA্Ͱ࡞͞ΕͨDropletɺCC্ʹอଘ͞Ε ඞཁʹԠ͡ͰDEAʹμϯϩʔυ͞Ε࣮ߦ͞ΕΔ XBSEFO XBSEFO
dea XBSEFO XBSEFO dea $$ shred
Service Brokers ࣮ମɺCloud ControllerͷதͷػೳͱαʔϏεଆͷBrokerͷػೳ XBSEFO XBSEFO dea NZTRM QPTUHSFT $$
shred αʔϏεͷ࡞ɾআ ͓ΑͼɺΞϓϦέʔγϣϯͱͷόΠϯυʗΞϯόΠϯυΛߦ͏ 4FSWJDF#SPLFS SFEJT
Message Bus ϦϙδτϦ໊শɿgnats ௨শɿnats https://github.com/nats-io/gnats ΞϓϦέʔγϣϯ wardenίϯςφʹΑִͬ͑ɾӡ༻͞ΕΔ ίϯϙʔωϯτؒ௨৴ XBSEFO XBSEFO
dea warden Linuxίϯςφٕज़Λϕʔεʹ Cloud Foundry্ͰΞϓϦέʔγϣϯΛ ࣮ߦ͢ΔͨΊʹඞཁ࠷ػೳͷΈ࣮
Logging and Statics ϦϙδτϦ໊শɿloggregator https://github.com/cloudfoundry/loggregator ϩΪϯά Cloud FoundryͷίϯϙʔωϯτʗΞϓϦέʔγϣϯͷϩάΛऩू͢Δ
Cloud Foundryͬͯ Ͳ͏ಈ͍͍ͯΔͷ͔
Cloud FoundryϚϧνIaaSରԠ
Cloud Foundry ͘͝Ұൠతͳ͝Ոఉʹ͋Δ OpenStackͷ্Ͱಈ͖·͢
ҰൠՈఉ֎ͷํ͚ bosh-lite nise_bosh_installer
Cloud Foundryͷಈ
←ग़ͯ͜ͳ͍ͳʔͱࢥͬͯ·ͨ͠ʁ
Diego ࠷ۙΞʔΩςΫνϟ
https://github.com/cloudfoundry-incubator/diego-design-notes
Diego DockerରԠ ↓ ਖ਼͘͠ɺDocker ImageରԠ DockeΤϯδϯະ༻ DockerfileɾࠩϑΝΠϧγεςϜΘͳ͍
Warden(͏͒ʔͲΜʣ Cloud Foundryʹɺ ͢Ͱʹಠࣗίϯςφ͕ͷ࣮͞Ε͍ͯΔ Garden ෦తʹ࣮͕มΘΔ Linux/WindowsʹରԠ
Garden Linux/Windows ͲͪΒdockerΠϝʔδΛ ৯͑ΔΑ͏ʹͳͬͯಈͣ͘ɾɾɾ چདྷͷΞϓϦLinuxଆͰରԠ
ࡉ͔͍͜ͷ͋ͨΓͰɻ http://www.slideshare.net/jacopen/diego-45603123