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
900
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とは何か? --「オープンソースAIの定義 v1.0」詳細解説
shujisado
7
810
複雑なState管理からの脱却
sansantech
PRO
1
140
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
370
AGIについてChatGPTに聞いてみた
blueb
0
130
フルカイテン株式会社 採用資料
fullkaiten
0
40k
Terraform未経験の御様に対してどの ように導⼊を進めていったか
tkikuchi
2
430
透過型SMTPプロキシによる送信メールの可観測性向上: Update Edition / Improved observability of outgoing emails with transparent smtp proxy: Update edition
linyows
2
210
Application Development WG Intro at AppDeveloperCon
salaboy
0
180
EventHub Startup CTO of the year 2024 ピッチ資料
eventhub
0
110
スクラム成熟度セルフチェックツールを作って得た学びとその活用法
coincheck_recruit
1
140
インフラとバックエンドとフロントエンドをくまなく調べて遅いアプリを早くした件
tubone24
1
430
Incident Response Practices: Waroom's Features and Future Challenges
rrreeeyyy
0
160
Featured
See All Featured
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Building Better People: How to give real-time feedback that sticks.
wjessup
364
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Embracing the Ebb and Flow
colly
84
4.5k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Testing 201, or: Great Expectations
jmmastey
38
7.1k
Visualization
eitanlees
145
15k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
31
2.7k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
Teambox: Starting and Learning
jrom
133
8.8k
Agile that works and the tools we love
rasmusluckow
327
21k
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