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
はてなインターンシップ2024 コンテナオーケストレーション講義資料
Search
Hatena
October 31, 2024
0
630
はてなインターンシップ2024 コンテナオーケストレーション講義資料
https://hatena.co.jp/recruit/intern/2024
Hatena
October 31, 2024
Tweet
Share
More Decks by Hatena
See All by Hatena
はてなインターンシップ2024 HTTP, Web, API 講義資料
hatena
0
910
はてなインターンシップ2024 RDBMS ブートキャンプ講義資料
hatena
0
710
はてなインターンシップ2024 フロントエンドブートキャンプ講義資料
hatena
0
640
はてなインターンシップ2024 コンテナ講義資料
hatena
0
700
はてなインターンシップ2024 インフラ講義資料
hatena
0
650
はてなインターンシップ2024 AI 講義資料
hatena
0
630
はてなインターンシップ2024 ブログライティング講義資料
hatena
4
2.4k
はてなリモートインターンシップ2023 Web, HTTP 講義資料
hatena
1
480
はてなリモートインターンシップ2023 Web API 講義資料
hatena
1
290
Featured
See All Featured
Documentation Writing (for coders)
carmenintech
65
4.4k
A Modern Web Designer's Workflow
chriscoyier
693
190k
Intergalactic Javascript Robots from Outer Space
tanoku
269
27k
Adopting Sorbet at Scale
ufuk
73
9.1k
Why You Should Never Use an ORM
jnunemaker
PRO
54
9.1k
Designing for Performance
lara
604
68k
How GitHub (no longer) Works
holman
310
140k
Teambox: Starting and Learning
jrom
133
8.8k
Thoughts on Productivity
jonyablonski
67
4.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
48k
Transcript
ίϯςφΦʔέετϨʔγϣϯ IBUFOBJOUFSO
ࣗݾհ id:masayosu SRE IBUFOBJOUFSO
͜ͷߨٛͰֶΜͰ΄͍͜͠ͱ Kubernetes Kubernetes IBUFOBJOUFSO
ίϯςφΦʔέετϨʔγϣϯͱ IBUFOBJOUFSO
ίϯςφ Docker: Build/Ship/Run 1 1 1 IBUFOBJOUFSO
ίϯςφΦʔέετϨʔγϣϯͱ 邾丗סؤ٤طػ畘杼յ鐧יⳂ־ג״סص٭ٜ ˝ ؤ٤طػ⺱㚖ֿ鵟⟓ך׀ֹמ ˝ 舅Ⳃמؤ٤طػ畘杼ؤتع峎 ˝ 냕ַ⺎榫䓪禴䧏 IBUFOBJOUFSO
ίϯςφΦʔέετϨʔγϣϯπʔϧ͕࣋ͭ ओͳػೳ / / IBUFOBJOUFSO
ίϯςφஔͷεέδϡʔϦϯά ˝ ؤ٤طػס㲔车丗䧗㲊յאס丗דׄؤ٤طػ玮י ˝ بتطّס靷蕔ײיյלסُب٤מؤ٤طػ玮י־舅 Ⳃך鹟䥃 IBUFOBJOUFSO
ෛՙࢄ/αʔϏεσΟεΧόϦʔ IP IBUFOBJOUFSO
ηϧϑώʔϦϯά ˝ ُب٤מ꤃㲹ֿ氦榟ג㕙⺬ ˝ 塜䅻םُب٤מؤ٤طػ鿥糋泡 ˝ ؤ٤طػמ꤃㲹ֿ氦榟ג㕙⺬ ˝ 䑒釐ם⮆דׄؤ٤طػ玮י泡 ˝
ؤ٤طػ꤃㲹吾湳ג״סىٜتزؘشؠ IBUFOBJOUFSO
ΦʔτεέʔϦϯά ׆סتآ٭ٛ٤ءյ靷蕔敯媲מ䑴י舅Ⳃך车ֹ CPU IBUFOBJOUFSO
Kubernetesͱ IBUFOBJOUFSO
Kubernetesͱ kubernetes, k s Google OSS AWS EKS, Google Cloud
GKE, Azure AKS IBUFOBJOUFSO
KubernetesͰԿ͕Ͱ͖Δͷ͔ʁ ؤ٤طػ؛٭آتعٝ٭ب٘٤ص٭ٜכי䧏ח׀嚀耆┉鵟⪵נ⤓ֻיַ / / Kubernetes IBUFOBJOUFSO
એݴతͳߏཧ Kubernetes (Manifest) 3 3 2 1 㵚拨氳םסעյ杯敯־ס䄐⮆⽜♐כי鋗鳭亠䌋 IBUFOBJOUFSO
Kubernetesͷߏ IBUFOBJOUFSO
Cluster Pod IBUFOBJOUFSO
Node Pod( ) or kubelet API IBUFOBJOUFSO
Pod Pod 1 IBUFOBJOUFSO
αΠυΧʔύλʔϯ pod ( ) Proxy, , IBUFOBJOUFSO
KubernetesͷϦιʔε IBUFOBJOUFSO
ϦιʔεͷΧςΰϦ Workloads Service Con g Storage Cluster Metadata Namespace IBUFOBJOUFSO
WorkloadsΧςΰϦ ؤ٤طػס㲔车מ꞊ٛخ٭ت Pod Pod IP Replicaset Pod Pod ( )
Pod IBUFOBJOUFSO
WorkloadsΧςΰϦ Deployment Replicaset IBUFOBJOUFSO
WorkloadsΧςΰϦ ♓┖յ☪㍑ס鐐갭ךע⮵榫ם Job CronJob job IBUFOBJOUFSO
ServiceΧςΰϦ Pod Service L Ingress L IBUFOBJOUFSO
kubernetesΫϥελͷ௨৴ Pod localhost Pod Pod IP pod IP IP Pod
IP Pod IP Pod pod IBUFOBJOUFSO
Service ϩʔυόϥϯα Pod ( ) 1 pod 2 pod pod
IP ClusterIP ( ) NodePort ( ) LoadBalancer( ) etc IBUFOBJOUFSO
Service αʔϏεσΟεΧόϦ Pod DNS DNS [SERVICE].[NAMESPACE]. [RESOURCE_TYPE].cluster.local DNS A (
) account.hatena- intern.svc.cluster.local IBUFOBJOUFSO
Ingress Ingress L (AWS ALB, Google Cloud GCLB, Nginx) Ingress
HTTPS IBUFOBJOUFSO
Ϧιʔεཧ IBUFOBJOUFSO
Manifest YAML kubectl apply -f <manifest> k s (yaml) IBUFOBJOUFSO
Manifestͷαϯϓϧ(Deployment) apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app:
nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.14.2 ports: - containerPort: 80 IBUFOBJOUFSO
Manifestͷαϯϓϧ(Service) apiVersion: v1 kind: Service metadata: name: nginx-service spec: selector:
app: nginx ports: - protocol: TCP port: 80 targetPort: 80 IBUFOBJOUFSO
Ϧιʔε੍ݶ Pod CPU Pod spec: containers: - name: nginx image:
nginx:1.14.2 ports: - containerPort: 80 resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "128Mi" cpu: "500m" IBUFOBJOUFSO
ϔϧενΣοΫ Pod Liveness Probe Pod Readiness Probe Pod Service IBUFOBJOUFSO
Մ༻ੑͱ֦ுੑ IBUFOBJOUFSO
Մ༻ੑ Replicaset Manifest Node Pod Node IBUFOBJOUFSO
ෛՙʹର͢Δ֦ுੑ Horizontal Pod Autoscaler (HPA) CPU Pod Vertical Pod Autoscaler
(VPA) CPU, IBUFOBJOUFSO
՝Ͱར༻͢Δπʔϧհ IBUFOBJOUFSO
Minikube Kubernetes https://minikube.sigs.k s.io/docs/start/ Kubernetes kind IBUFOBJOUFSO
Kustomize https://github.com/kubernetes-sigs/kustomize k s Dev, Stg, Prd Manifest kustomization.yaml secret
con g IBUFOBJOUFSO
Skaffold https://ska old.dev/ k s skaffold.yaml docker IBUFOBJOUFSO
·ͱΊ IBUFOBJOUFSO
Kubernetesͷྑ͍ͱ͜Ζ Pod, Node Cloud Native Computing Fondation(CNCF) https://landscape.cncf.io/ CI/CD GitOps
CI/CD Node Pod Spot IBUFOBJOUFSO
Kubernetesͷ͍͠ͱ͜Ζ 4 Blue/Green Node IBUFOBJOUFSO