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
How Kubernetes works
Search
Kazuki Suda
August 30, 2017
Technology
7
1.2k
How Kubernetes works
Mini Tech Talk at GREE, inc. 2017.08.30
Kazuki Suda
August 30, 2017
Tweet
Share
More Decks by Kazuki Suda
See All by Kazuki Suda
個人的、Kubernetes の最新注目機能! (2024年5月版)
superbrothers
0
81
Kubernetes + containerd で cgroup v2 に移行したら "failed to create fsnotify watcher" エラーが発生する原因と対策
superbrothers
0
1.3k
Kubernetes にこれから入るかもしれない注目機能!(2022年11月版)
superbrothers
2
1.4k
コミュニティ/ 勉強会紹介
superbrothers
0
220
高可用性、省力運用を目指す 自宅 Kubernetes クラスタ (K8s@home #1)
superbrothers
12
5.3k
KubeCon + CloudNativeCon Europe 2022 Recap
superbrothers
0
48
独断と偏見で選んだ Kubernetes 1.24 の注目機能と今後!
superbrothers
2
7.6k
わかる!metadata.managedFields
superbrothers
4
2k
Local ephemeral-storage のメトリクスを取得するのに kube-summary-exporter がべんり / kube-summary-exporter is useful to get the metrics of local ephemeral-storage
superbrothers
0
650
Other Decks in Technology
See All in Technology
.NET 最新アップデート ~ AI とクラウド時代のアプリモダナイゼーション
chack411
0
200
comilioとCloudflare、そして未来へと向けて
oliver_diary
6
440
デジタルアイデンティティ技術 認可・ID連携・認証 応用 / 20250114-OIDF-J-EduWG-TechSWG
oidfj
2
680
Alignment and Autonomy in Cybozu - 300人の開発組織でアラインメントと自律性を両立させるアジャイルな組織運営 / RSGT2025
ama_ch
1
2.4k
実践! ソフトウェアエンジニアリングの価値の計測 ── Effort、Output、Outcome、Impact
nomuson
0
2.1k
生成AI × 旅行 LLMを活用した旅行プラン生成・チャットボット
kominet_ava
0
160
AWSサービスアップデート 2024/12 Part3
nrinetcom
PRO
0
140
なぜfreeeはハブ・アンド・スポーク型の データメッシュアーキテクチャにチャレンジするのか?
shinichiro_joya
2
470
Formal Development of Operating Systems in Rust
riru
1
420
自社 200 記事を元に整理した読みやすいテックブログを書くための Tips 集
masakihirose
2
330
Building Scalable Backend Services with Firebase
wisdommatt
0
110
30分でわかる「リスクから学ぶKubernetesコンテナセキュリティ」/30min-k8s-container-sec
mochizuki875
3
450
Featured
See All Featured
Producing Creativity
orderedlist
PRO
343
39k
Fireside Chat
paigeccino
34
3.1k
Statistics for Hackers
jakevdp
797
220k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Git: the NoSQL Database
bkeepers
PRO
427
64k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
28
4.5k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
173
51k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
870
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.2k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
Transcript
.JOJ5FDI5BMLBU(3&& JOD ,B[VLJ4VEBLTVEB![MBCDPKQ !TVQFSCSPUIFST )PX,VCFSOFUFTXPSLT
갭歊♧鰛,B[VLJ4VEB Ӝ 4PGUXBSF&OHJOFFS!;-BC Ӝ !TVQFSCSPUIFST Ӝ ,VCFSOFUFT.FFUVQ5PLZP
،آؑٝت 8IBUJT,VCFSOFUFT 8IZ,VCFSOFUFT )PX,VCFSOFUFTXPSLT
What is Kubernetes?
,VCFSOFUFT Ӝ ؝ٝذشؔ٦؛أزٖ٦ءّٝخ٦ٕ ؝ٝذشךꂁ⪒ծ鏣㹀ծ盖椚遤ֲ Ӝ ĜĦĔėģğήĥęςؘٔءٍ铂ד乼菭㡦 Ӝ (PPHMFך爡ⰻءأذيַ؎ٝأػ؎،ׁ “Kubernetes
is open source—a contrast to Borg and Omega, which were developed as purely Google-internal systems. “ Borg, Omega, and Kubernetes https://research.google.com/pubs/pub44843.html
Google - Site Reliability Engineering
https://twitter.com/brendandburns/status/585479466648018944
➭ךفٓحزؿؓ٦يהך嫰鯰 Ӝ *OGSBTUSVDUVSFBTB 4FSWJDF Ӝ 7. ر؍أؙ طحز ٙ٦ؙ
,VCFSOFUFT Ӝ $POUBJOFSBTB4FSWJDF Ӝ ؝ٝذشך盖椚ծ㹋遤 Ӝ ֮ײ،فٔ؛٦ءّٝ $MPVE'PVOESZ Ӝ 1MBUGPSNBTB4FSWJDF Ӝ ؝٦سַرفٗ؎ Ӝ )551ծ"1*ծ8FC 0QFO4UBDL
Why Kubernetes?
,VCFSOFUFTכؔ٦فٝד֮ Ӝ ؔ٦فٝا٦أاؿزؐؑ، HJUIVCDPNLVCFSOFUFTLVCFSOFUFT "QBDIF-JDFOTF Ӝ ؔ٦فٝرؠ؎ٝ HJUIVCDPNLVCFSOFUFTDPNNVOJUZ Ӝ
ؔ٦فٝ؝ىُصذ؍ 4QFDJBM*OUFSFTU(SPVQT 4*(T 4MBDL 4UBDL0WFSPX Ⰻ⚅歲ד⟃♳ךى٦ز،حف Ӝ $MPVE/BUJWF$PNQVUJOH'PVOEBUJPO $/$'
$VSSFOU1SPKFDUT Kubernetes Orchestration Prometheus Monitoring OpenTracing Tracing flutentd Logging Linkerd
Service Mesh GRPC Remote Procedure Call CoreDNS Service Discovery Containerd Container Runtime rkt Container Runtime CNI Networking https://www.cncf.io/projects/
https://www.cncf.io/about/members/ 1MBUJOVN.FNCFST
1MBUJOVN.FNCFST https://www.cncf.io/about/members/
,VCFSOFUFTכه٦ةـٕד֮ Ӝ DMPVEQSPWJEFS --# ـٗحؙأزٖ٦آזוך乼⡲䬄韋⻉ ($1 "84 "[VSF 0QFO4UBDL
Ӝ $/* $POUBJOFS/FUXPSL*OUFSGBDF $BMJDP 'MBOOFM 0QFOW4XJUDI 8FBWF Ӝ $POUBJOFS3VOUJNF %PDLFS SLU DSJP
,VCFSOFUFTכ䧭ꞿ׃גְ Kubernetes Docker Swarm Apache Mesos All Time Statistics
Contributors 1,473 201 288 Commits 49,619 3,331 24,308 12 Month Statistics Contributors 756 66 155 Commits 19,223 567 7,946 https://www.openhub.net/p/_compare?project_0=Kubernetes&project_1=docker+swarm&project_2=Apache+Mesos As of 17/06/12
None
How Kubernetes works
،٦ؗذؙثٍ CLI API UI Master Node 1 Node “n”
؝،؝ٝإفز Ӝ 1PET Ӝ 3FQMJDB4FUT Ӝ %FQMPZNFOUT Ӝ 4FSWJDFT
1PET Ӝ 醱侧ך؝ٝذشה 醱侧ךنُٔ٦ي Ӝ رفٗ؎ך剑㼭⽃⡘ Ӝ *1QFS1PE 1PE
Volume Web Server Agent
1PET Ӝ 醱侧ך؝ٝذشה 醱侧ךنُٔ٦ي Ӝ رفٗ؎ך剑㼭⽃⡘ Ӝ *1QFS1PE apiVersion:
v1 kind: Pod metadata: name: nginx spec: containers: - name: nginx image: nginx:1.13.3 ports: - containerPort: 80
3FQMJDB4FUT Ӝ /⦐ך1PEָ㹋遤ׁגְ朐䡾⥂א 3FQMJDB4FU Replicas: 2 Selector: app=web Pod
Template 1PE app web 1PE app web
3FQMJDB4FUT Ӝ /⦐ך1PEָ㹋遤ׁגְ朐䡾⥂א 3FQMJDB4FU Replicas: 2 Selector: app=web Pod
Template 1PE app web
3FQMJDB4FUT Ӝ /⦐ך1PEָ㹋遤ׁגְ朐䡾⥂א 3FQMJDB4FU Replicas: 2 Selector: app=web Pod
Template 1PE app web 1PE app web
3FQMJDB4FUT Ӝ /⦐ך1PEָ 㹋遤ׁגְ朐䡾⥂א apiVersion: extensions/v1beta1 kind: ReplicaSet metadata:
name: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.13.3 ports: - containerPort: 80
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v1 Pod
Template 1PE app:v1 1PE app:v1 34 Replicas: 2 app:v1 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v2 Pod
Template 1PE app:v1 1PE app:v1 34 Replicas: 2 app:v1 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v2 Pod
Template 1PE app:v1 1PE app:v1 34 34 Replicas: 2 app:v1 Replicas: 1 app:v2 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v2 Pod
Template 1PE app:v1 1PE app:v1 34 34 Replicas: 2 app:v1 1PE app:v2 Replicas: 1 app:v2 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v2 Pod
Template 1PE app:v1 1PE app:v1 34 34 Replicas: 1 app:v1 1PE app:v2 Replicas: 1 app:v2 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v2 Pod
Template 1PE app:v1 34 34 Replicas: 1 app:v1 1PE app:v2 Replicas: 1 app:v2 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v2 Pod
Template 1PE app:v1 34 34 Replicas: 2 app:v2 Replicas: 1 app:v1 1PE app:v2 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT %FQMPZNFOU Replicas: 2 Selector: app=web image: app:v2 Pod
Template 1PE app:v1 1PE app:v2 34 34 Replicas: 2 app:v2 Replicas: 1 app:v1 1PE app:v2 Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ
%FQMPZNFOUT Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ %FQMPZNFOU Replicas: 2 Selector:
app=web image: app:v2 Pod Template 1PE app:v1 1PE app:v2 34 34 Replicas: 2 app:v2 Replicas: 0 app:v1 1PE app:v2
%FQMPZNFOUT Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ %FQMPZNFOU Replicas: 2 Selector:
app=web image: app:v2 Pod Template 1PE app:v2 34 34 Replicas: 2 app:v2 Replicas: 0 app:v1 1PE app:v2
%FQMPZNFOUT Ӝ ٗ٦ؚٔٝ،حفر٦ز Ӝ ٗ٦ٕغحؙ apiVersion: apps/v1beta1 kind: Deployment
metadata: name: nginx spec: replicas: 2 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.13.3 ports: - containerPort: 80
4FSWJDFT Ӝ ⟎䟝*1הه٦ز Ӝ ٓكٕإؙٖةח״ 1PEךؚٕ٦ؾؚٝ Ӝ ؟٦ؽأة؎ف $MVTUFS*1 /PEF1PSU
-PBE#BMBODFS 1PE app web 1PE app web 3FQMJDB4FU 4FSWJDF VIP: 10.0.0.249 Selector: app=web
4FSWJDFT Ӝ ⟎䟝*1הه٦ز Ӝ ٓكٕإؙٖةח״ 1PEךؚٕ٦ؾؚٝ Ӝ ؟٦ؽأة؎ف $MVTUFS*1 /PEF1PSU
-PBE#BMBODFS apiVersion: v1 kind: Service metadata: name: nginx spec: type: ClusterIP selector: app: nginx ports: - protocol: TCP port: 80 targetPort: 80
*OHSFTT Ӝ -頾蚚ⴓ侔 Ӝ غ٦ثٍٕمأز Ӝ ػأח״䮶ⴓֽ Ӝ 5-4穄畭
4FSWJDFGPP 4FSWJDFCBS *OHSFTT /foo /bar example.com
*OHSFTT Ӝ -頾蚚ⴓ侔 Ӝ غ٦ثٍٕمأز Ӝ ػأח״䮶ⴓֽ Ӝ 5-4穄畭
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: example-com spec: rules: - host: example.com http: paths: - path: /foo backend: serviceName: foo servicePort: 80 - path: /bar backend: serviceName: bar servicePort: 80
ך➭ Ӝ /BNFTQBDFTؙٓأةⴓⶴׅ Ӝ $POH.BQT،فٔ؛٦ءّٝה鏣㹀ךⴓꨄ Ӝ 4FDSFUT،فٔ؛٦ءّٝהء٦ؙٖحزךⴓꨄ Ӝ 1FSTJTUFOU7PMVNFT 1FSTJTUFOU7PMVNF$MBJNT
4UPSBHF$MBTT宕竲نُٔ٦ي Ӝ 4UBUFGVM4FUTأذ٦زؿٕ،فٔ؛٦ءّٝ Ӝ +PCTٙٝءّحزآّـ Ӝ $SPO+PCآّـך㹀劍㹋遤 Ӝ %BFNPO4FUTⰋגךظ٦سד1PE㹋遤 Ӝ )PMJ[POUBM1PE"VUP4DBMFSؔ٦زأ؛٦ٕ
،٦ؗذؙثٍ CLI API UI Master Node 1 Node “n”
،٦ؗذؙثٍ $POUSPMMFS .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS CLI API UI
Master Node 1 Node “n” $POUBJOFS 3VOUJNF LVCFMFU LVCFMFU $POUBJOFS 3VOUJNF
FUDE㈓♧ךر٦ةأز، $POUSPMMFS .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS Master Ӝ $1㘗ךⴓ侔ؗ٦غُٔ٦أز،
Ӝ أذ٦زכⰋגFUDEח⥂㶷ׁ Ӝ ؐؓحث؟ه٦ز׃גֶծ أذ٦زך㢌刿כח➭ך ؝ٝه٦طٝزח鸐濼ׁ Ӝ IUUQHJUIVCDPNDPSFPTFUDE CLI API UI
BQJTFSWFS3&45 $36% 钠鏾钠〳 $POUSPMMFS .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS Master
Ӝ 3&45Ⳣ椚הغٔر٦ءّٝ Ӝ 钠鏾钠〳 Ӝ ㈓♧FUDEחر٦ة剅ֹ鴥 Ӝ ؽآطأٗآحؙכ㹋鄲ׁגְזְ CLI API UI
4DIFEVMFS1PEךأ؛آُ٦ؚٔٝ $POUSPMMFS .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS Master Ӝ 1PEךٔا٦أ銲実זו罋䣁׃ג
黝ⴖז/PEFחأ؛آُ٦ؚׅٔٝ Ӝ أ؛آُ٦ٕׅ/PEF 䭷㹀ֿׅהדֹ resources: requests: memory: "64Mi" cpu: "250m" CLI API UI
$POUSPMMFS.BOBHFSؽآطأٗآحؙ $POUSPMMFS .BOBHFS FUDE 4DIFEVMFS BQJTFSWFS Master Ӝ 3FQMJDB4FUT
4FSWJDFTזוծٔا٦أך ؽآطأٗآحָؙ㹋鄲ׁגְ CLI API UI
LVCFMFU $POUBJOFS 3VOUJNF Node $POUBJOFS3VOUJNF BQJTFSWFS Master Ӝ ؝ٝذش؎ً٦آך《䖤ה㹋遤
Ӝ $3*$POUBJOFS3VOUJNF*OUFSGBDF %PDLFS SLU DSJP
LVCFMFU $POUBJOFS 3VOUJNF Node LVCFMFU BQJTFSWFS Master Ӝ /PEFח䌢꽎ׅؒ٦آؑٝز
Ӝ BQJTFSWFSؐؓحث׃גծ荈魦ך /PEFח1PEָأ؛آُ٦ׁٕה ؝ٝذش؎ً٦آך《䖤ծ㹋遤遤ֲ Ӝ ؝ٝذشך朐䡾ח䘔ׄגBQJTFSWFS 鸐ׄג1PEךأذ٦ز刿倜ׅ
)PXB1PEJTTDIFEVMFE Core Kubernetes: Jazz Improv over Orchestration
״鑫׃ֻ濼חכ Ӝ LVCFSOFUFTJP Ӝ TMBDLLTJPKQVTFST KQFWFOUT Ӝ ,VCFSOFUFT.FFUVQ5PLZPCJUMZLTKQ Ӝ ,VCFSOFUFT6QBOE3VOOJOH03FJMMZ.FEJB
Ӝ #PSH 0NFHB BOE,VCFSOFUFT
5IBOLT Ӝ 4MJEF CJUMZIPXLTXPSLT Ӝ 2VFTUJPOT ,B[VLJ4VEBLTVEB![MBCDPKQ !TVQFSCSPUIFST