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
kubernetes-seminar
Search
Tomoki Sugiura
May 15, 2019
0
150
kubernetes-seminar
Tomoki Sugiura
May 15, 2019
Tweet
Share
More Decks by Tomoki Sugiura
See All by Tomoki Sugiura
CiliumによるKubernetes Network Policyの実現 CNDT2021
shanpu
0
1k
naist colloquium-B 2
shanpu
0
180
ricc-20210826
shanpu
0
450
IOT53
shanpu
0
50
RICC-PIoT Workshop 2021
shanpu
0
570
ricc-nii-2020
shanpu
0
97
Cloud Native Kansai #05 LT4
shanpu
1
920
gcpug-kyoto#2-LT1
shanpu
0
620
KansaiLT2
shanpu
0
220
Featured
See All Featured
Designing Experiences People Love
moore
138
23k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
32
2.7k
Testing 201, or: Great Expectations
jmmastey
40
7.1k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Building Adaptive Systems
keathley
38
2.3k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Rails Girls Zürich Keynote
gr2m
94
13k
Being A Developer After 40
akosma
87
590k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
Transcript
Kubernetes جૅษڧձ TIBOQV
ͶΒ͍ 2 ˓ ,VCFSOFUFTͷجૅΛֶͼࠓޙͷษڧʹཱͯͯΒ͏ ˓ ,VCFSOFUFTͷ͜ͱΛ͖ʹͳͬͯΒ͏
Agenda 3 ,VCFSFOFUFTͱ LVCFDUMɾLVCFOTɾLVCFDUY 8PSLMPBETϦιʔε ೝূͱΞʔΩςΫνϟ
%JTDPWFSZ-#Ϧιʔε $POpH4USBHFϦιʔε 0UIFST ͍͞͝ʹ
Link 4 ˓ ϋϯζΦϯࢿྉ ˔ IUUQTHJUIVCDPNDIF[TIBOQVLTTFNJOBS ˓ ࿅श ˔ IUUQTHJUIVCDPNEHLBOBUTJPT$,"%FYFSDJTFT
1. Kubernetesͱ 5
ಡΈํ 6 ,VCFSOFUFT LT SEL@KIT
History 7
KubernetesԿΛߦ͏ʁ 8 ˓ ίϯςφͷཧΛ͍͍ײ͡ʹߦ͏
Kubernetesͷಛ 9 ˓ ϚχϑΣετϑΝΠϧ ˓ εέʔϦϯά ˓ εέδϡʔϦϯά ˓ Ϧιʔεཧ
˓ ηϧϑώʔϦϯά ˓ σʔλͷཧ SEL@KIT
2. kubectlɾkubensɾkubectx 10
KubeCLIπʔϧࡾॐ࢜ 11 ˓ LVCFDUM ˔ ,VCFSOFUFTʹର͢Δ͋ΔΏΔૢ࡞Λߦͬͯ͘ΕΔίϚϯυ ˔ ࣮ࡍʹ,VCFSOFUFTͷ3&45"1*TFSWFSʹରͯ͠ϦΫΤετ Λૹ͍ͬͯΔ ˓
LVCFOT ˔ OBNFTQBDFͷΓସ͑Λ؆୯ʹͯ͘͠ΕΔ ˓ LVCFDUY ˔ DPOUFYUͷΓସ͑Λ؆୯ʹͯ͘͠ΕΔ
kubectl جຊίϚϯυ 12 ˓ ALVCFDUMHFUϦιʔεA ˔ ࢦఆͨ͠ϦιʔεͷεςʔλεΛऔಘ ˔ ALVCFDUMHFUϦιʔε໊લPZBNMAͰͦͷϦιʔεͷϚ χϑΣετΛݟΔ͜ͱͰ͖Δ
˓ ALVCFDUMEFTDSJCFϦιʔε໊લA ˔ ໊લͰࢦఆͨ͠ϦιʔεͷৄࡉΛදࣔ
kubectl جຊίϚϯυ 13 ˓ ALVCFDUMBQQMZGϑΝΠϧͷύεA ˔ ϚχϑΣετϑΝΠϧΛΫϥελʹద༻͢Δ ˓ ALVCFDUMSVOΦϓγϣϯA ˔
໋ྩతʹϦιʔεΛੜ͢Δ ˓ ALVCFDUMDSFBUFϦιʔε໊લA ˔ ࢦఆ໊ͨ͠લͰࢦఆͨ͠ϦιʔεΛ࡞ ˔ ࡞Ͱ͖ΔϦιʔεͷछྨʹݶΓ͋Γ
kubectl جຊίϚϯυ 14 ˓ ALVCFDUMEFMFUFϦιʔε໊લA ˔ ࢦఆͨ͠ϦιʔεΛআ ˔ GͰϚχϑΣετʹهࡌ͞Ε͍ͯΔϦιʔεΛআ ˓
ALVCFDUMFYQMBJOϦιʔε ϑΟʔϧυ໊ A ˔ ֤ϦιʔεͷϚχϑΣετϑΝΠϧʹهࡌ͢ΔϑΟʔϧυͷ ใΛදࣔ
kubensɾkubectx 15 ˓ LVCFOT ˔ ΫϥελͷOBNFTQBDFΛҰཡදࣔ ˔ ALVCFOTOBNFTQBDF໊AͰOBNFTQBDFͷΓସ͑ ˓ LVCFDUY
˔ ࣗͷॴ͍࣋ͯ͠ΔίϯςΩετΛҰཡදࣔ ˔ ALVCFDUYίϯςΩετ໊AͰίϯςΩετͷΓସ͑
3. WorkloadsϦιʔε 16
ུ֓ਤ 17
Pod (po) 18 ˓ 8PSLMPETϦιʔεͷ࠷খ୯Ґ ˓ $POUBJOFS㱨1PE ˓ σβΠϯύλʔϯ ˔
αΠυΧʔύλʔϯ ˔ Ξϯόαμʔύλʔϯ ˔ Ξμϓλύλʔϯ
ReplicaSet (rs) 19 ˓ SFQMJDBTͰҡ͍࣋ͨ͠1PEͷ Λࢦఆ ˓ 3FQMJDB4FU୯ମͰ͏͜ͱ ͋·Γͳ͍ ˔
ޙड़ͷ%FQMPZNFOUΛ͏
Deployment (deploy) 20 ˓ 3FQMJDB4FUΛཧ ˔ ϩʔϦϯάΞοϓσʔτ ˔ ϩʔϧόοΫ ˓
BQQMZ͢Δͱదͳ3FQMJDB4FU Λ࡞
DeploymentͷϩʔϦϯάΞοϓσʔτ 21
DeploymentͷϩʔϦϯάΞοϓσʔτ 22
StatefulSet (sts) 23 ˓ σʔλΛӬଓԽ͢ΔΈ Λඋ͑Δ ˓ 1PEͷ໊લʹΠϯσοΫε ͕αϑΟοΫεͱͯͭ͘͠
DaemonSet (ds) 24 ˓ ֤ϊʔυʹඞͣҰͭ1PEΛ ஔ͢Δ ˓ /PEF4FMFDUPSΛ͑ ஔ͠ͳ͍͜ͱՄೳ
Job 25 ˓ ίϯςφΛར༻ͯ͠ҰݶΓ ͷॲཧΛ࣮ߦͤ͞Δ ˓ ࣮ߦํ๏ྃ݅ΛࢦఆͰ ͖Δ ˔ /ฒྻͰ࣮ߦͯ͠΄͍͠
˔ /ճޭͨ͠Βਖ਼ৗऴྃʹͯ͠ ΄͍͠ ˔ /ճࣦഊͨ͠Β͏͠ͳͯ͘ ͍͍
CronJob (cj) 26 ˓ +PCΛఆظ࣮ߦ ͯ͘͠ΕΔ
4. ೝূͱΞʔΩςΫνϟ 27
NamespaceͱRBAC 28
ClusterͱNode 29
MasterNodeͱNode 30
5. Discovery & LB Ϧιʔε 31
ClusterIPɾExternalIP 32 ˓ $MVTUFS*1 ˔ Ϋϥελ෦ͷ*1 ˓ &YUFSOBM*1 ˔ Ϋϥελ֎෦ͱૄ௨ੑͷ͋
Δ*1
NodePort 33 ˓ ͦΕͧΕͷ/PEFͷࢦఆ 1PSUͷτϥϑΟοΫΛɼ ͦΕʹඥ͚ͮͨ1PEͷ1PSU సૹ ˓ $MVTUFS*1ࣗಈతʹൃߦ
LoadBalancer 34 ˓ Ϋϥελ֎ʹ-#Λ࡞ ˔ -#ʹ֎෦ૄ௨ੑͷ͋Δ*1Λ ༩
Ingress 35 ˓ -ͷϩʔυόϥϯα ˓ *OHSFTT$POUSPMMFS͕ ผ్ඞཁ
6. Config & Strage Ϧιʔε 36
Secret 37 ˓ ओʹػີใͷอʹ͏ ˓ ,FZ7BMVFͷܗͰهड़ ˓ 7BMVFCBTFͰΤϯ ίʔυ
ConfigMap (cm) 38 ˓ 4FDSFUͷػີใ͡Όͳ͍൛ ˓ ϑΝΠϧͷதΛॻ͍ͯͦΕ ΛϚϯτͤ͞Δ͍ํΑ ͘͢Δ
PersistentVolume (pv) 39 ˓ ӬଓԽྖҬͱͯ֬͠อ ˓ ༧ΊετϨʔδΛ༻ҙ͓ͯ͘͠
PersistentVolumeClaim (pvc) 40 ˓ 1FSTJTUFOU7PMVNF$MBJN ܦ༝Ͱ17Λ֬อ͢Δ ˓ 17$ͷཁٻʹ߹ͬͨ17͕ ͍ग़͞ΕΔ
7. Others 41
NetworkPolicy 42 ˓ 1PEಉ࢜ͷ௨৴Λ੍ޚ ˔ ྫ ಉ͡/BNFTQBDFͷ1PE ͔͠௨৴Ͱ͖ͳ͍Α͏ʹ͢Δ
NodeSelectorɾNodeAffinity 43 ˓ 1PEͷεέδϡʔϦϯά ઌΛࢦఆ ˓ 1PETQFDʹهड़ ˓ /PEF"⒏OJUZͷํ͕ΑΓ ࡉ͔͍݅ઃఆ͕Մೳ
TaintɾTolerations 44 ˓ 5BJOUʢԚΕʣ ˔ 1PEΛεέδϡʔϦϯά ͤ͞ͳ͍ ˓ 5PMFSBUJPOTʢ༰ʣ ˔
5BJOUͷ͍ͭͨ/PEFʹ εέδϡʔϦϯά͞ΕΔ
Ϧιʔεͷ੍ݶ 45 ˓ ༻͢ΔϚγϯϦιʔεͷ ্ݶͱԼݶΛઃఆͰ͖Δ
8. ͍͞͝ʹ 46
հͰ͖ͳ͔ͬͨ͜ͱ 47 ˓ )PSJ[POUBM1PE"VUPTDBMFS ˓ 7FSUJDBM1PE"VUPTDBMFS ˓ %SBJOɼ$PSEPOɼ6ODPSEPO ˓ 1PE%JTSVQUJPO#VEHFU
˓ $VTUPN3FTPVSDF%FpOJUJPO ˓ $MVTUFS3PMFɼ$MVTUFS3PMF#JOEJOH ˓ 4FSWJDF"DDPVOU FUD
ࢀߟਤॻ 48 ˓ ,VFCFSOFUFTશΨΠυ ˔ ,VCFSOFUFTͷجຊཁૉΛཏ ͍ͯ͠Δ ˔ αϯϓϧίʔυɼਤଟ͘Θ͔ Γ͍͢
˓ ଞʹ,VCFSOFUFTຊ͋Δ ˔ ͠ങͬͨਓ͕͍ͨΒײڭ͑ ͍ͯͩ͘͞
Πϕϯτ& Slack 49 ˓ Πϕϯτ ˔ DPOOQBTTͰௐΔͱΘΓͱώοτ͢Δ ˔ ,VCFSOFUFT.FFUVQ5PLZPͳͲϏσΦ৴͍ͯ͠ΔΠϕϯτ͋Δ ˓
4MBDL ˔ ,VCFSOFUFTϢʔβͷͨΊͷϫʔΫεϖʔε͕͋Δ ˔ ຊਓͷͨΊͷνϟϯωϧ͋Δ ˔ ௐͯΘ͔Βͳ͍͜ͱ͜͜ʹ͛ͯΈΔͷΑ͍
50 ͓ർΕ༷Ͱͨ͠