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
170
ricc-20210826
shanpu
0
440
IOT53
shanpu
0
44
RICC-PIoT Workshop 2021
shanpu
0
550
ricc-nii-2020
shanpu
0
94
Cloud Native Kansai #05 LT4
shanpu
1
910
gcpug-kyoto#2-LT1
shanpu
0
610
KansaiLT2
shanpu
0
210
Featured
See All Featured
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
Optimizing for Happiness
mojombo
376
70k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.8k
4 Signs Your Business is Dying
shpigford
180
21k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
250
21k
Typedesign – Prime Four
hannesfritz
40
2.4k
BBQ
matthewcrist
85
9.3k
The Cult of Friendly URLs
andyhume
78
6k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
Happy Clients
brianwarren
98
6.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
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 ͓ർΕ༷Ͱͨ͠