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
190
Vault Secrets Operator Tutorial
ry
0
450
KyvernoとRed Hat ACMを用いたマルチクラスターの一元的なポリシー制御
ry
0
910
明日から始められるKyvernoを用いたポリシー制御
ry
3
700
CNDT2022 k8snovice Community introduction
ry
0
110
Policy Engine on Kubernetes
ry
1
1.3k
ConfigMap and Secret
ry
0
310
Policy Manager試してみた!
ry
0
370
Kubernetes APIに Pod内からアクセスしてみた
ry
1
1.6k
Other Decks in Education
See All in Education
認知情報科学科_キャリアデザイン_大学院の紹介
yuyakurodou
0
140
BrightonSEO, San Diego, CA 2024
mchowning
0
100
Chapitre_1_-__L_atmosphère_et_la_vie_-_Partie_2.pdf
bernhardsvt
0
210
1127
cbtlibrary
0
170
オープンソース防災教育ARアプリの開発と地域防災での活用
nro2daisuke
0
210
コンセプトシェアハウス講演資料
uchinomasahiro
0
520
Adobe Express
matleenalaakso
1
7.6k
Carving the Way to Ruby Engineering
koic
3
470
The Task is not the End: The Role of Task Repetition and Sequencing In Language Teaching
uranoken
0
230
Nodiレクチャー 「CGと数学」講義資料 2024/11/19
masatatsu
1
260
Lisätty todellisuus opetuksessa
matleenalaakso
1
2.3k
Algo de fontes de alimentación
irocho
1
450
Featured
See All Featured
Rails Girls Zürich Keynote
gr2m
94
13k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
38
1.9k
What's in a price? How to price your products and services
michaelherold
243
12k
VelocityConf: Rendering Performance Case Studies
addyosmani
326
24k
Designing for humans not robots
tammielis
250
25k
Being A Developer After 40
akosma
87
590k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
29
2k
Practical Orchestrator
shlominoach
186
10k
Reflections from 52 weeks, 52 projects
jeffersonlam
347
20k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.1k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
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Λબ