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
30
はてなインターンシップ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
150
はてなインターンシップ2024 RDBMS ブートキャンプ講義資料
hatena
0
43
はてなインターンシップ2024 フロントエンドブートキャンプ講義資料
hatena
0
24
はてなインターンシップ2024 コンテナ講義資料
hatena
0
43
はてなインターンシップ2024 インフラ講義資料
hatena
0
14
はてなインターンシップ2024 AI 講義資料
hatena
0
18
はてなインターンシップ2024 ブログライティング講義資料
hatena
0
25
はてなリモートインターンシップ2023 Web, HTTP 講義資料
hatena
1
470
はてなリモートインターンシップ2023 Web API 講義資料
hatena
1
280
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.4k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Into the Great Unknown - MozCon
thekraken
31
1.5k
StorybookのUI Testing Handbookを読んだ
zakiyama
26
5.2k
RailsConf 2023
tenderlove
29
880
What’s in a name? Adding method to the madness
productmarketing
PRO
22
3.1k
Building an army of robots
kneath
302
42k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
7
150
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
27
1.9k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
167
49k
Teambox: Starting and Learning
jrom
132
8.7k
A Tale of Four Properties
chriscoyier
156
23k
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