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
rootlessコンテナのすゝめ - 研究室サーバーでもできる安全なコンテナ管理
kitsuya0828
3
390
ノーコードデータ分析ツールで体験する時系列データ分析超入門
negi111111
0
430
OTelCol_TailSampling_and_SpanMetrics
gumamon
1
220
適材適所の技術選定 〜GraphQL・REST API・tRPC〜 / Optimal Technology Selection
kakehashi
1
710
New Relicを活用したSREの最初のステップ / NRUG OKINAWA VOL.3
isaoshimizu
3
640
100 名超が参加した日経グループ横断の競技型 AWS 学習イベント「Nikkei Group AWS GameDay」の紹介/mediajaws202411
nikkei_engineer_recruiting
1
170
"とにかくやってみる"で始めるAWS Security Hub
maimyyym
2
100
SREが投資するAIOps ~ペアーズにおけるLLM for Developerへの取り組み~
takumiogawa
2
470
初心者向けAWS Securityの勉強会mini Security-JAWSを9ヶ月ぐらい実施してきての近況
cmusudakeisuke
0
130
開発生産性を上げながらビジネスも30倍成長させてきたチームの姿
kamina_zzz
2
1.7k
20241120_JAWS_東京_ランチタイムLT#17_AWS認定全冠の先へ
tsumita
2
300
iOSチームとAndroidチームでブランチ運用が違ったので整理してます
sansantech
PRO
0
150
Featured
See All Featured
A designer walks into a library…
pauljervisheath
204
24k
Unsuck your backbone
ammeep
668
57k
The Pragmatic Product Professional
lauravandoore
31
6.3k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
0
110
RailsConf 2023
tenderlove
29
900
Docker and Python
trallard
40
3.1k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
Bash Introduction
62gerente
608
210k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
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