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
【re:Invent 2024 アプデ】 Prompt Routing の紹介
champ
0
150
オプトインカメラ:UWB測位を応用したオプトイン型のカメラ計測
matthewlujp
0
180
ゼロから創る横断SREチーム 挑戦と進化の軌跡
rvirus0817
2
270
レンジャーシステムズ | 会社紹介(採用ピッチ)
rssytems
0
210
Amazon VPC Lattice 最新アップデート紹介 - PrivateLink も似たようなアップデートあったけど違いとは
bigmuramura
0
200
サイバー攻撃を想定したセキュリティガイドライン 策定とASM及びCNAPPの活用方法
syoshie
3
1.3k
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
930
podman_update_2024-12
orimanabu
1
280
Storage Browser for Amazon S3
miu_crescent
1
250
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
200
組織に自動テストを書く文化を根付かせる戦略(2024冬版) / Building Automated Test Culture 2024 Winter Edition
twada
PRO
17
4.8k
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
120
Featured
See All Featured
Being A Developer After 40
akosma
87
590k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.4k
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
Put a Button on it: Removing Barriers to Going Fast.
kastner
59
3.6k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
50
2.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
A Philosophy of Restraint
colly
203
16k
Visualization
eitanlees
146
15k
Side Projects
sachag
452
42k
Keith and Marios Guide to Fast Websites
keithpitt
410
22k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
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