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
Docker/Kubernetes社内勉強会#1 公開資料 / Study basic of ...
Search
Kohei Ota
August 16, 2019
Technology
20
29k
Docker/Kubernetes社内勉強会#1 公開資料 / Study basic of Docker and Kubernetes
Kohei Ota
August 16, 2019
Tweet
Share
More Decks by Kohei Ota
See All by Kohei Ota
CloudNative Meets WebAssembly: Exploring Wasm's Potential to Replace Containers
inductor
4
2.4k
The Cloud Native Chronicles: 10 Years of Community Growth Inside and Outside Japan
inductor
0
120
Cracking the KubeCon CfP
inductor
2
570
KubeCon Recap -Platform migration at Scale-
inductor
1
980
コンテナビルド最新事情 2022年度版 / Container Build 2022
inductor
3
490
データベースとストレージのレプリケーション入門 / Intro-of-database-and-storage-replication
inductor
28
6.3k
KubeConのケーススタディから振り返る、Platform for Platforms のあり方と その実践 / Lessons from KubeCon case studies: Platform for Platforms and its practice
inductor
3
810
オンラインの技術カンファレンスを安定稼働させるための取り組み / SRE activity for online conference platform
inductor
1
1.2k
Kubernetesネットワーキング初級者脱出ガイド / Kubernetes networking beginner's guide
inductor
21
6.2k
Other Decks in Technology
See All in Technology
SSH公開鍵認証による接続 / Connecting with SSH Public Key Authentication
kaityo256
PRO
2
230
TopAppBar Composableをカスタムする
hunachi
0
140
Engineering Managementのグローバルトレンド #emoasis / Engineering Management Global Trend
kyonmm
PRO
6
1k
小さく始めるDevOps 内製化支援から見えたDevOpsの始め方 / 20250317 Ken Takayanagi
shift_evolve
1
110
Enterprise AI in 2025?
pamelafox
0
110
近年の PyCon 情勢から見た PyCon APAC のまとめ
terapyon
0
130
製造業の会計システムをDDDで開発した話
caddi_eng
3
1k
DevinはクラウドエンジニアAIになれるのか!? 実践的なガードレール設計/devin-can-become-a-cloud-engineer-ai-practical-guardrail-design
tomoki10
3
1.4k
ゆるくVPC Latticeについてまとめてみたら、意外と奥深い件
masakiokuda
2
100
銀行でDevOpsを進める理由と実践例 / 20250317 Masaki Iwama
shift_evolve
1
120
お問い合わせ対応の改善取り組みとその進め方
masartz
1
430
SpannerとAurora DSQLの同時実行制御の違いに想いを馳せる
masakikato5
0
570
Featured
See All Featured
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
160
15k
Code Review Best Practice
trishagee
67
18k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
4 Signs Your Business is Dying
shpigford
183
22k
Making the Leap to Tech Lead
cromwellryan
133
9.2k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
22
2.6k
Fontdeck: Realign not Redesign
paulrobertlloyd
83
5.5k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
GraphQLの誤解/rethinking-graphql
sonatard
70
10k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
12
620
It's Worth the Effort
3n
184
28k
Designing for humans not robots
tammielis
251
25k
Transcript
ࣾϓϩδΣΫτ ษڧձ %PDLFS,VCFSOFUFT͜ͱ͡Ί ࣾϓϩδΣΫτ ษڧձ גࣜձࣾ;0;0ςΫϊϩδʔζ ։ൃ෦
.-0QTνʔϜ ଠా ߤฏ $PQZSJHIU;0;05FDIOPMPHJFT *OD
;0;05FDIOPMPHJFT *OD ˔%PDLFSͷ͓͞Β͍ ˔%PDLFSίϯςφͱ%PDLFSΠϝʔδ ˔%PDLFSͰղܾͰ͖Δ͜ͱɾղܾͰ͖ͳ͍͜ͱ ˔ίϯςφɾΦʔέετϨʔγϣϯͷجૅ ˔,VCFSOFUFTͷΞʔΩςΫνϟ֓ཁ ΞδΣϯμ 2
;0;05FDIOPMPHJFT *OD ˔%PDLFSͷ͓͞Β͍ ˔%PDLFSίϯςφͱ%PDLFSΠϝʔδ ˔%PDLFSͰղܾͰ͖Δ͜ͱɾղܾͰ͖ͳ͍͜ͱ ˔ίϯςφɾΦʔέετϨʔγϣϯͷجૅ ˔,VCFSOFUFTͷΞʔΩςΫνϟ֓ཁ ΞδΣϯμ 3
;0;05FDIOPMPHJFT *OD ˔EPU$MPVEࣾ %PDLFSࣾͷલ ͕ࣗࣾͷ1BB4 1MBUGPSN BTB4FSWJDF Λ࡞ΔͨΊʹ։ൃͨ͠ίϯςφܕԾԽ ͷΞϓϦέʔγϣϯ࣮ߦج൫ ˔طଘͷ7.ܕԾԽʹൺɺىಈ͕ඇৗʹߴ
%PDLFSͷ͓͞Β͍ 4
;0;05FDIOPMPHJFT *OD ˔ίϯςφܕԾԽʁ ˓ίϯςφͱ ˙ΞϓϦέʔγϣϯͷ࣮ߦʹඞཁͳڥΛ Ұͭͷύοέʔδʹ·ͱΊͨԾతͳ୯Ґ ˔04ΑΓԼͷϨΠϠΛʮ-JOVYΧʔωϧʯΛͬͯ ࠶ݱ͢ΔԾԽٕज़ %PDLFSͷ͓͞Β͍ 5
(Go/Java/Ruby...)
;0;05FDIOPMPHJFT *OD -JOVY,FSOFM %PDLFS&OHJOF JT ! 6
;0;05FDIOPMPHJFT *OD ˔%PDLFSͷ͓͞Β͍ ˔%PDLFSίϯςφͱ%PDLFSΠϝʔδ ˔%PDLFSͰղܾͰ͖Δ͜ͱɾղܾͰ͖ͳ͍͜ͱ ˔ίϯςφΦʔέετϨʔγϣϯͷجૅ ˔,VCFSOFUFTͷΞʔΩςΫνϟ֓ཁ ΞδΣϯμ 7
;0;05FDIOPMPHJFT *OD ˔%PDLFS্Ͱʮ͜͏͍͏ৼΔ͍Λ͢Δʯͱ͍͏ఆٛ ˔%PDLFSGJMFΛॻ͘ˠϏϧυ͢Δ %PDLFSΠϝʔδ ˓࣮ଶUBSܗࣜͰ·ͱΊͨΞʔΧΠϒϑΝΠϧ ˔͜ͷ࣌Ͱ·࣮ͩࡍʹಈ࡞͍ͯ͠ΔΘ͚Ͱͳ͍ %PDLFSΠϝʔδͱ 8 Dockerfile
docker build Docker
;0;05FDIOPMPHJFT *OD ˔%PDLFSϗετͷ্Ͱ࣮ࡍʹಈ࡞͢Δϓϩηε ˔ίϯςφΛ্ཱͪ͛ΔͨΊʹɺϕʔεͱͳΔ %PDLFSΠϝʔδ͕ඞཁ %PDLFSίϯςφͱ 9 Docker Docker
Docker Docker docker run
;0;05FDIOPMPHJFT *OD ˔ݴ͍͑ΔͱɺԼهΛ࣮ߦͨ͠ͷ͕ίϯςφʹͳΔ ˓%PDLFSGJMF͔Β࡞ͨ͠खݩͷΠϝʔδ ˓࡞ࡁΈͷ֎෦ΠϝʔδΛϨδετϦ͔Βऔಘ %PDLFSίϯςφͱ 10 Docker Docker
Docker Docker docker run
;0;05FDIOPMPHJFT *OD ˔%PDLFSGJMF͔ΒΠϝʔδΛϏϧυ ˔Ϗϧυͨ͠ΠϝʔδΛϨδετϦʹ1VTI ˔ಈ͔͍ͨ͠ڥͰΠϝʔδΛ1VMM͠ɺίϯςφΛىಈ ˔͜ͷྲྀΕΛ·ͱΊͯʮ#VJME 4IBSF 3VOʯͱݺͿ #VJME 4IBSF
3VO 11 Dockerfile docker build Docker Docker docker run
;0;05FDIOPMPHJFT *OD %PDLFSΠϝʔδ͕ͦͷ·· ʮΰʔϧσϯΠϝʔδʯͱͳΔͨΊɺ ϥΠϒϥϦݴޠϥϯλΠϜͷ όʔδϣϯࠩҟ͕ੜ·Εʹ͍͘ 12
;0;05FDIOPMPHJFT *OD ˔%PDLFSͷ͓͞Β͍ ˔%PDLFSίϯςφͱ%PDLFSΠϝʔδ ˔%PDLFSͰղܾͰ͖Δ͜ͱɾղܾͰ͖ͳ͍͜ͱ ˔ίϯςφΦʔέετϨʔγϣϯͷجૅ ˔,VCFSOFUFTͷΞʔΩςΫνϟ֓ཁ ΞδΣϯμ 13
;0;05FDIOPMPHJFT *OD ˔%PDLFSͰղܾͰ͖Δ͜ͱ ˓શڥͷڞ௨Խ ˙ϚϧνΫϥυԽʹ͓͚Δύοέʔδϯάච಄ީิ ˙ΫϥυɾΦϯϓϨ্ͱ։ൃڥͱͷࠩҟΛzݮΒ͢z ˓ߴͳΞϓϦέʔγϣϯ৴ɾσϓϩΠ ˓$*ͳͲʹΑΔࣗಈԽਪਐ ˙ςετಉҰڥͰ࣮ߦՄ %PDLFSۜͷؙͰͳ͍
14
;0;05FDIOPMPHJFT *OD ˔%PDLFS͕ۤखͳ͜ͱ ˓ϞϊϦγοΫͳΞϓϦέʔγϣϯͷཧ ˙%#ͳͲͷεςʔτͷཧͱ͔ۤख ˠ5IF5XFMWF'BDUPS"QQ ˠ$MPVE/BUJWF5SBJM.BQ %PDLFSۜͷؙͰͳ͍ 15
;0;05FDIOPMPHJFT *OD ˔%PDLFSͰղܾͰ͖ͳ͍͜ͱ ˓ΞϓϦέʔγϣϯͷੈཧ ˓ࣗಈεέʔϦϯά ˓ॊೈͳϦιʔεཧ ˓ϩΪϯάɺࢹ %PDLFSۜͷؙͰͳ͍ 16
;0;05FDIOPMPHJFT *OD %PDLFSΛຊ൪ڥͰ ಈ͔͢ʹ͍͔ͭ͘ͷ՝͕͋Δ 17
;0;05FDIOPMPHJFT *OD ˔%PDLFSͷ͓͞Β͍ ˔%PDLFSίϯςφͱ%PDLFSΠϝʔδ ˔%PDLFSͰղܾͰ͖Δ͜ͱɾղܾͰ͖ͳ͍͜ͱ ˔ίϯςφΦʔέετϨʔγϣϯͷجૅ ˔,VCFSOFUFTͷΞʔΩςΫνϟ֓ཁ ΞδΣϯμ 18
;0;05FDIOPMPHJFT *OD ˔ຊ൪ڥͰෳͷίϯςφΛಈ͔͢͜ͱ͕Ұൠత ˓Մ༻ੑোੑΛ্͛ΔͨΊ ˓ࣗಈεέʔϦϯάɺϩʔυόϥϯγϯάɺࣗݾ෮چʑ ˔֤ίϯςφಠཱ͓ͯ͠Γɺ͓ޓ͍Λೝࣝ͠ͳ͍ͨΊ ԿΒ͔ͷཧϨΠϠ͕ඞཁʹͳΔ ˠΦʔέετϨʔγϣϯπʔϧΛೖΕΔ ΦʔέετϨʔγϣϯʁʁ 19
;0;05FDIOPMPHJFT *OD ˔%PDLFSίϯςφΞϓϦέʔγϣϯ։ൃʹ͓͍ͯ ैདྷ՝ͱͳ͍͍͔ͬͯͨͭ͘ͷΛղফͯ͘͠ΕΔ ˔%PDLFS୯ମͰຊ൪ӡ༻ʹඞཁͳཧ༻ͷػೳ͕ෆ ͍ͯ͠ΔͨΊɺಋೖʹ͕͋Δ ˔ͦΕΒΛղܾ͢ΔʹɺίϯςφΦʔέετϨʔγϣ ϯ͕ඞཁ ͜͜·Ͱͷ·ͱΊ 20
;0;05FDIOPMPHJFT *OD ˔%PDLFSͷ͓͞Β͍ ˔%PDLFSίϯςφͱ%PDLFSΠϝʔδ ˔%PDLFSͰղܾͰ͖Δ͜ͱɾղܾͰ͖ͳ͍͜ͱ ˔ίϯςφΦʔέετϨʔγϣϯͷجૅ ˔,VCFSOFUFTͷΞʔΩςΫνϟ֓ཁ ΞδΣϯμ 21
;0;05FDIOPMPHJFT *OD ˔,VCFSOFUFTίϯςφΦʔέετϨʔγϣϯπʔϧͷ ʮσϑΝΫτελϯμʔυʯ ,VCFSOFUFTʁ 22
;0;05FDIOPMPHJFT *OD 23
;0;05FDIOPMPHJFT *OD ˔ίϯςφ 1PE Λத৺ͱͨ͠ࢄγεςϜ ˓ϫʔΫϩʔυ͕ৗʹʮ͋Δ͖ঢ়ଶʯΛอͭΑ͏ಈ͘ ,VCFSOFUFTͷ֓ཁ 24 Ref: https://kubernetes.io/docs/tutorials/kubernetes-basics/explore/
;0;05FDIOPMPHJFT *OD :".-ʹΑΔߏཧ 25
;0;05FDIOPMPHJFT *OD ˔ίϯςφͷઃఆ ˓ϕʔεΠϝʔδɺόʔδϣϯɺϙʔτ ˔ཁٻ͢Δ$16ϝϞϦͳͲͷϦιʔε ˔ϔϧενΣοΫ ˔ڥม ˔ࣗಈεέʔϧͷεέʔϧΠϯΞτͷ݅ :".-ʹΑΔએݴతͳઃఆ 26
;0;05FDIOPMPHJFT *OD ˔ίϯςφͷઃఆ ˓ϕʔεΠϝʔδɺόʔδϣϯɺϙʔτ ˔ཁٻ͢Δ$16ϝϞϦͳͲͷϦιʔε ˔ϔϧενΣοΫ ˔ڥม ˔ࣗಈεέʔϧͷεέʔϧΠϯΞτͷ݅ :".-ʹΑΔએݴతͳઃఆ 27
;0;05FDIOPMPHJFT *OD 28
;0;05FDIOPMPHJFT *OD ,VCFSOFUFTͷϦιʔε جຊฤ 29
;0;05FDIOPMPHJFT *OD ˔Ϧιʔεͱ ˓,VCFSOFUFTʹ͓͚Δجຊతͳίϯϙʔωϯτͷ୯Ґ ˔,VCFSOFUFT͕ѻ͏શͯͷந֓೦Ϧιʔε ˓1PE ˓/PEF ˓$POGJH.BQFUD ,VCFSOFUFTͱϦιʔε 30
;0;05FDIOPMPHJFT *OD ˔,VCFSOFUFTϦιʔε:".-Ͱهड़͞ΕɺఆٛͰ͖Δ ˔͜͜ͰΞϓϦέʔγϣϯ։ൃऀʹ͓͍ͬͯͯΒ͍ ͍ͨͷΛத৺ʹհ͠·͢ Ϧιʔεͱ:".- 31
;0;05FDIOPMPHJFT *OD ˔ίϯςφΛಈ͔ͨ͢Ίͷ࠷খ͔ͭجຊ୯Ґ ˓ίϯςφͷجຊઃఆʢΠϝʔδछผʣ ˓Ϧιʔε੍ݶ ˓ϘϦϡʔϜ ͳͲͷఆٛΛઃఆՄೳ 1PEϦιʔε 32
;0;05FDIOPMPHJFT *OD 33 Image credit: https://cstoku.dev/
;0;05FDIOPMPHJFT *OD ˔1PEΛෳ͢ΔϦιʔε ˔͜Ε͕ࣗίϯςφΛಈ͔͢ͷͰͳ͘ɺ1PEΛࢦఆ͠ ͚ͨͩ࡞ͯͦ͠ΕΛཧ͢Δ1PE.BOBHFSͷׂ 3FQMJDB4FUϦιʔε 34
;0;05FDIOPMPHJFT *OD 35 Image credit: https://cstoku.dev/
;0;05FDIOPMPHJFT *OD ˔࣮ӡ༻ͰίϯςφΛಈ͔͢ͳΒ͜Ε ˔3FQMJDB4FUͷػೳʹՃ͑ɺίϯςφͷΞοϓσʔτઓུ όʔδϣϯཤྺͳͲΛཧ͢ΔػೳΛ࣋ͭ %FQMPZNFOUϦιʔε 36
;0;05FDIOPMPHJFT *OD 37 % ! ) "'
$(&+ *# Image credit: https://cstoku.dev/
;0;05FDIOPMPHJFT *OD ˔$POGJH.BQ,FZ7BMVFͳจࣈྻΛѻ͏Ϧιʔε ˔ྫ͑ҎԼͷΑ͏ͳใΛ1PEʹೖ͍ͨ͠߹ʹ͏ ˓/HJOY3BJMTͳͲͷ$POGJHϑΝΠϧ ˙Θ͟Θ͟ϘϦϡʔϜϚϯτ͢Δ·Ͱͳ͍ͷ ˓ڥม $POGJH.BQϦιʔε 38
;0;05FDIOPMPHJFT *OD 39 4FSWJDFɺ*OHSFTTͳͲͷϦιʔεॏཁͰ͕͢ɺ ࠓճίϯςφͷಈ࡞·ΘΓʹϑΥʔΧε͍ͯ͠ ΔͨΊઆ໌ΛׂѪ͍ͯ͠·͢
;0;05FDIOPMPHJFT *OD :".-ߏཧʹΑΔքͷมԽ 40 VM
SSH Git push VM
;0;05FDIOPMPHJFT *OD 41 VM
SSH Git push VM :".-ߏཧʹΑΔքͷมԽ
;0;05FDIOPMPHJFT *OD ։ൃεΩʔϚͷมԽͱ %FW0QT 42 ˔։ൃͱΠϯϑϥͷ֞ࠜͷϥΠϯ͕มΘΔ ˓ΞϓϦଆͰߏͷมߋΛՃ͑ΒΕΔൣғ͕૿͑Δ ˔%FW0QTͷઢҾΛܾΊΔͷϓϩμΫταʔϏεʹ ؔΘΔΤϯδχΞࣗ
;0;05FDIOPMPHJFT *OD 43 8JOEPXTͷαϙʔτʁ
;0;05FDIOPMPHJFT *OD 44
;0;05FDIOPMPHJFT *OD 45 ,VCFSOFUFT͔Β 1SPEVDUJPOMFWFMͷ 8JOEPXTαϙʔτ͕։࢝͞Ε·ͨ͠ʂ ࠓͷ࠷৽
;0;05FDIOPMPHJFT *OD ˞8JOEPXTίϯςφͬͨ͜ͱ͕ ͳ͍ͷͰΑ͘Θ͔Γ·ͤΜ 46
;0;05FDIOPMPHJFT *OD ˔%PDLFSίϯςφΞϓϦέʔγϣϯ։ൃʹ͓͍ͯ ैདྷ՝ͱͳ͍͍͔ͬͯͨͭ͘ͷΛղফͯ͘͠ΕΔ ˔%PDLFS୯ମͰຊ൪ӡ༻ʹඞཁͳཧ༻ͷػೳ͕ෆ ͍ͯ͠ΔͨΊɺίϯςφΦʔέετϨʔγϣϯ͕ඞཁ ˓,VCFSOFUFTͦͷڥΛఏڙͯ͘͠ΕΔͭͷखஈ ·ͱΊ 47
;0;05FDIOPMPHJFT *OD ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ 48
None