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
Lecture__1.pdf
Search
ry
February 10, 2020
Education
1
280
Lecture__1.pdf
ry
February 10, 2020
Tweet
Share
More Decks by ry
See All by ry
eBPF Tools on Kubernetes part1
ry
0
210
Vault Secrets Operator Tutorial
ry
0
460
KyvernoとRed Hat ACMを用いたマルチクラスターの一元的なポリシー制御
ry
0
940
明日から始められるKyvernoを用いたポリシー制御
ry
3
700
CNDT2022 k8snovice Community introduction
ry
0
110
Policy Engine on Kubernetes
ry
1
1.3k
ConfigMap and Secret
ry
0
320
Policy Manager試してみた!
ry
0
380
Kubernetes APIに Pod内からアクセスしてみた
ry
1
1.6k
Other Decks in Education
See All in Education
Logistique et supply chain : application au e-commerce
martine
0
120
ヘイトスピーチがある世界のコミュニケーション
ktanishima
0
690
Web Application Frameworks - Lecture 4 - Web Technologies (1019888BNR)
signer
PRO
0
2.7k
BEM FASILKOM UNEJ Navaratna
bemilkomunej24
0
130
自分にあった読書方法を探索するワークショップ / Reading Catalog Workshop
aki_moon
0
280
Human Perception and Cognition - Lecture 4 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
810
Algo de fontes de alimentación
irocho
1
470
中野区ミライ★ライター倶楽部presents『MINT』
nakamuramikumirai
0
340
AI 時代軟體工程師的持續升級
mosky
0
1.4k
保育士チームが実践している連続的な観察と多面的な観察を共有するための振り返り / Reflection to share “continuous and multifaceted observations” as practiced by a team of childcare professionals
psj59129
0
2.7k
H5P-työkalut
matleenalaakso
4
37k
Adobe Express
matleenalaakso
1
7.6k
Featured
See All Featured
[RailsConf 2023] Rails as a piece of cake
palkan
53
5.2k
Unsuck your backbone
ammeep
669
57k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
3
360
Automating Front-end Workflow
addyosmani
1366
200k
The Pragmatic Product Professional
lauravandoore
32
6.4k
Building Your Own Lightsaber
phodgson
104
6.2k
Making Projects Easy
brettharned
116
6k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
174
51k
How GitHub (no longer) Works
holman
312
140k
Practical Orchestrator
shlominoach
186
10k
Scaling GitHub
holman
459
140k
Transcript
Lecture for today’s theme ry (@URyo_0213) 2020/2/10 Kubernetes Wakaran Tokyo
#1
Podͷ࡞ ղ • metadata Podʹ༩͑Δmetadata - Podʹ`nginx`ͱ͍͏໊લ - ֎෦͔ΒͷҹͱͳΔlabel Λ༩͍ͯ͠Δɻ
• spec.containers Containerͷใ Container name: nginx image: nginx (version 1.17.5) exported port: 80
Podͱ • WorkloadsϦιʔεͷ࠷খ୯Ґ • 1ͭҎ্ͷίϯςφ͔Βߏ͞ΕΔ • PodͷίϯςφɺωοτϫʔΫΛڞ༗͢Δ ·ͯΑ… ͲΜͳ࣌ʹPodͷதʹ ෳίϯςφೖΕΔΜͩʁʁʁ
جຊύλʔϯ • αΠυΧʔύλʔϯ • Ξϯόαμύλʔϯ • Ξμϓλύλʔϯ ~ Ԡ༻ ~
• ελοΫɾΪϟβʔ • etc…
جຊύλʔϯ • αΠυΧʔύλʔϯ • Ξϯόαμύλʔϯ • Ξμϓλύλʔϯ ~ Ԡ༻ ~
• ελοΫɾΪϟβʔ • etc…
αΠυΧʔύλʔϯ • PodͷதͰɺmainίϯςφ(ΞϓϦέʔγϣϯ )ͷػೳ֦ு ิॿΛ͢ΔίϯςφΛΈࠐΉύλʔϯ ྫ) αΠυΧʔproxy Proxy App http://10.200.100.20
http://localhost App Pod
Ξϯόαμύλʔϯ • ֎෦ͷαʔϏεͷհͱͳΔίϯςφΛಉҰPodʹ࣋ͭ ύλʔϯ ྫ) γϟʔσΟϯάΞϯόαμ App Ambassador http://localhost:port shard
#3 shard #2 shard #1 App Pod
Ξμϓλύλʔϯ • ֎෦ͷαʔϏε(ࢹLogging)͔Βͷ൚༻తͳΠϯλʔϑΣ ΠεΛఏڙ͢ΔίϯςφΛΈࠐΉύλʔϯ ྫ) Redis Exporter + Prometheus Redis
Adapter - Exporter EternalService - Prometheus
Workloads Ϧιʔεͱ???
Workloads Ϧιʔε • Pod • ReplicaSet • Deployment • DaemonSet
• StatefulSet • Job • CronJob
Workloads Ϧιʔε • Pod • ReplicaSet • Deployment • DaemonSet
• StatefulSet • Job • CronJob
ReplicaSet ࢦఆ͞ΕͨཧͷϨϓϦΧʹ͢ΔͨΊʹPodͷ࡞ ͱআΛߦ͏Ϧιʔε ྫ) replica = 4
ReplicaSet manifest • Selector spec.template.metadata.label Λࢀর͠ɺReplicaΛੜ͢Δର ͷPodΛબ͢Δɻ ɹ(spec.selector.matchLabelsͱ spec.template.labels͕Ұக͠ͳ͍ɹ ɹ߹ɺError͕ग़ͯ࡞͕Ͱ͖ͳ͍)
• templateԼPodͷmanifestͱҰॹ
Deployment DeploymentReplicaSetͷཧΛ͠ɺϩʔϦϯά ΞοϓσʔτϩʔϧόοΫͳͲͷએݴతͳΞοϓ σʔτػೳΛఏڙ ྫ) replica = 4 (RollingUpdateத) Deployment
New Old
Deployment manifest • ReplicaSetͱಉ༷ • UpdateStrategy(spec.strategy) ʹؔͯ͠লུ
DaemonSet ReplicaSetͷಛघܥ ֤Nodeʹ1ͭͣͭஔ͢ΔͨΊɺReplicaͷࢦఆ ͕Ͱ͖ͳ͍ɻ( ஔͨ͘͠ͳ͍Node͕͋Δ߹ɺ Node Anti-AffinityͰ੍ޚՄೳ)
DaemonSet manifest • ReplicaSetͷΑ͏ͳspec.replica͕ ࢦఆͰ͖ͳ͍͕ɺͦΕҎ֎ಉ༷
StatefulSet ReplicaSetͷಛघܥ εέʔϦϯά(ݮΒ࣌͢1൪େ͖͍ΠϯσοΫε ͔Β)ɺPodͷ࡞(1ͭͣͭॱʹ࡞)ͳͲڍಈʹ ҧ͍͕͋Δɻ [ReplicaSet໊] - [ϥϯμϜͳจࣈྻ] [StatefulSet໊] -
[index൪߸] RepliaSet StatefulSet
StatefulSet manifest • جຊReplicaSetͱҰॹ • spec.serviceNameʹͯservice໊ Λࢦఆ͢Δඞཁ͕͋Δɻ
Replicaͷ࡞ ղ • ΞϓϦέʔγϣϯΛಈ͔͢ࡍɺ DBͱҧ͍ɺॊೈͳΞοϓ σʔτͷઓུΛऔΓ͍ͨɻ (× StatefulSet, DaemonSet) •
ϦιʔεΛߟྀͨ͠Nodeஔ ͕ඞཁʹͳΔɻ (× DaemonSet) ΑͬͯDeploymentΛબ