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
200
Vault Secrets Operator Tutorial
ry
0
450
KyvernoとRed Hat ACMを用いたマルチクラスターの一元的なポリシー制御
ry
0
930
明日から始められる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
370
Kubernetes APIに Pod内からアクセスしてみた
ry
1
1.6k
Other Decks in Education
See All in Education
Flinga
matleenalaakso
2
14k
5 Things Every L&D Pro Should Steal from Marketing
tmiket
0
110
Repaso electricidade e electrónica
irocho
0
220
1030
cbtlibrary
0
330
HTML5 and the Open Web Platform - Lecture 3 - Web Technologies (1019888BNR)
signer
PRO
1
2.6k
Sähköiset kyselyt, kokeet ja arviointi
matleenalaakso
1
17k
Human Perception and Cognition - Lecture 4 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
780
ヘイトスピーチがある世界のコミュニケーション
ktanishima
0
540
Ch2_-_Partie_1.pdf
bernhardsvt
0
120
Генезис казарменной архитектуры
pnuslide
0
160
Nodiレクチャー 「CGと数学」講義資料 2024/11/19
masatatsu
1
260
認知情報科学科_キャリアデザイン_大学院の紹介
yuyakurodou
0
150
Featured
See All Featured
Statistics for Hackers
jakevdp
796
220k
Making Projects Easy
brettharned
116
6k
Optimising Largest Contentful Paint
csswizardry
33
3k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
120k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
YesSQL, Process and Tooling at Scale
rocio
170
14k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
2k
Fashionably flexible responsive web design (full day workshop)
malarkey
406
66k
Docker and Python
trallard
43
3.2k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
248
1.3M
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Λબ