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
Opcodeを読んでいたら何故かphp-srcを読んでいた話
murashotaro
0
250
開発生産性向上! 育成を「改善」と捉えるエンジニア育成戦略
shoota
2
360
Google Cloud で始める Cloud Run 〜AWSとの比較と実例デモで解説〜
risatube
PRO
0
100
DUSt3R, MASt3R, MASt3R-SfM にみる3D基盤モデル
spatial_ai_network
2
130
Amazon Kendra GenAI Index 登場でどう変わる? 評価から学ぶ最適なRAG構成
naoki_0531
0
110
どちらを使う?GitHub or Azure DevOps Ver. 24H2
kkamegawa
0
800
LINEヤフーのフロントエンド組織・体制の紹介【24年12月】
lycorp_recruit_jp
0
530
Microsoft Azure全冠になってみた ~アレを使い倒した者が試験を制す!?~/Obtained all Microsoft Azure certifications Those who use "that" to the full will win the exam! ?
yuj1osm
2
110
スタートアップで取り組んでいるAzureとMicrosoft 365のセキュリティ対策/How to Improve Azure and Microsoft 365 Security at Startup
yuj1osm
0
220
LINE Developersプロダクト(LIFF/LINE Login)におけるフロントエンド開発
lycorptech_jp
PRO
0
120
日本版とグローバル版のモバイルアプリ統合の開発の裏側と今後の展望
miichan
1
130
AWS re:Invent 2024で発表された コードを書く開発者向け機能について
maruto
0
190
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
28
900
Chrome DevTools: State of the Union 2024 - Debugging React & Beyond
addyosmani
2
170
Designing on Purpose - Digital PM Summit 2013
jponch
116
7k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.1k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
59k
Statistics for Hackers
jakevdp
796
220k
Music & Morning Musume
bryan
46
6.2k
A Tale of Four Properties
chriscoyier
157
23k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
How to Think Like a Performance Engineer
csswizardry
22
1.2k
The Language of Interfaces
destraynor
154
24k
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