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
AWS re:Invent 2024 ふりかえり
kongmingstrap
0
130
20241220_S3 tablesの使い方を検証してみた
handy
3
390
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
180
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
MLOps の現場から
asei
6
640
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
バクラクのドキュメント解析技術と実データにおける課題 / layerx-ccc-winter-2024
shimacos
2
1.1k
AIのコンプラは何故しんどい?
shujisado
1
190
マイクロサービスにおける容易なトランザクション管理に向けて
scalar
0
120
kargoの魅力について伝える
magisystem0408
0
200
株式会社ログラス − エンジニア向け会社説明資料 / Loglass Comapany Deck for Engineer
loglass2019
3
32k
Oracle Cloud Infrastructure:2024年12月度サービス・アップデート
oracle4engineer
PRO
0
180
Featured
See All Featured
Designing Experiences People Love
moore
138
23k
Fontdeck: Realign not Redesign
paulrobertlloyd
82
5.3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
247
1.3M
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
45
2.2k
Raft: Consensus for Rubyists
vanstee
137
6.7k
For a Future-Friendly Web
brad_frost
175
9.4k
Embracing the Ebb and Flow
colly
84
4.5k
Building Applications with DynamoDB
mza
91
6.1k
Practical Orchestrator
shlominoach
186
10k
4 Signs Your Business is Dying
shpigford
181
21k
Docker and Python
trallard
42
3.1k
A designer walks into a library…
pauljervisheath
204
24k
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