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
620
はてなインターンシップ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
900
はてなインターンシップ2024 RDBMS ブートキャンプ講義資料
hatena
0
700
はてなインターンシップ2024 フロントエンドブートキャンプ講義資料
hatena
0
630
はてなインターンシップ2024 コンテナ講義資料
hatena
0
690
はてなインターンシップ2024 インフラ講義資料
hatena
0
640
はてなインターンシップ2024 AI 講義資料
hatena
0
620
はてなインターンシップ2024 ブログライティング講義資料
hatena
3
2.2k
はてなリモートインターンシップ2023 Web, HTTP 講義資料
hatena
1
480
はてなリモートインターンシップ2023 Web API 講義資料
hatena
1
290
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
A Modern Web Designer's Workflow
chriscoyier
693
190k
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
GitHub's CSS Performance
jonrohan
1030
460k
Navigating Team Friction
lara
183
14k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
109
49k
Being A Developer After 40
akosma
86
590k
Product Roadmaps are Hard
iamctodd
PRO
49
11k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
10 Git Anti Patterns You Should be Aware of
lemiorhan
654
59k
Practical Orchestrator
shlominoach
186
10k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
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