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
3
1.8k
The Cloud Native Chronicles: 10 Years of Community Growth Inside and Outside Japan
inductor
0
100
Cracking the KubeCon CfP
inductor
2
450
KubeCon Recap -Platform migration at Scale-
inductor
1
940
コンテナビルド最新事情 2022年度版 / Container Build 2022
inductor
3
450
データベースとストレージのレプリケーション入門 / Intro-of-database-and-storage-replication
inductor
26
6.1k
KubeConのケーススタディから振り返る、Platform for Platforms のあり方と その実践 / Lessons from KubeCon case studies: Platform for Platforms and its practice
inductor
3
760
オンラインの技術カンファレンスを安定稼働させるための取り組み / SRE activity for online conference platform
inductor
1
1.2k
Kubernetesネットワーキング初級者脱出ガイド / Kubernetes networking beginner's guide
inductor
19
6k
Other Decks in Technology
See All in Technology
小学3年生夏休みの自由研究「夏休みに Copilot で遊んでみた」
taichinakamura
0
150
.NET 9 のパフォーマンス改善
nenonaninu
0
830
統計データで2024年の クラウド・インフラ動向を眺める
ysknsid25
2
840
10個のフィルタをAXI4-Streamでつなげてみた
marsee101
0
160
サイボウズフロントエンドエキスパートチームについて / FrontendExpert Team
cybozuinsideout
PRO
5
38k
複雑性の高いオブジェクト編集に向き合う: プラガブルなReactフォーム設計
righttouch
PRO
0
110
プロダクト開発を加速させるためのQA文化の築き方 / How to build QA culture to accelerate product development
mii3king
1
260
PHP ユーザのための OpenTelemetry 入門 / phpcon2024-opentelemetry
shin1x1
1
180
alecthomas/kong はいいぞ / kamakura.go#7
fujiwara3
1
300
コンテナセキュリティのためのLandlock入門
nullpo_head
2
320
私なりのAIのご紹介 [2024年版]
qt_luigi
1
120
5分でわかるDuckDB
chanyou0311
10
3.2k
Featured
See All Featured
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.3k
A better future with KSS
kneath
238
17k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
48
2.2k
Automating Front-end Workflow
addyosmani
1366
200k
Typedesign – Prime Four
hannesfritz
40
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.4k
The Art of Programming - Codeland 2020
erikaheidi
53
13k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
0
97
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