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
780
はてなインターンシップ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
1.1k
はてなインターンシップ2024 RDBMS ブートキャンプ講義資料
hatena
0
860
はてなインターンシップ2024 フロントエンドブートキャンプ講義資料
hatena
0
790
はてなインターンシップ2024 コンテナ講義資料
hatena
0
870
はてなインターンシップ2024 インフラ講義資料
hatena
0
800
はてなインターンシップ2024 AI 講義資料
hatena
0
790
はてなインターンシップ2024 ブログライティング講義資料
hatena
4
2.9k
はてなリモートインターンシップ2023 Web, HTTP 講義資料
hatena
1
490
はてなリモートインターンシップ2023 Web API 講義資料
hatena
1
300
Featured
See All Featured
Designing for Performance
lara
604
68k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
Done Done
chrislema
181
16k
Mobile First: as difficult as doing things right
swwweet
222
9k
Building Flexible Design Systems
yeseniaperezcruz
327
38k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
810
Measuring & Analyzing Core Web Vitals
bluesmoon
4
170
We Have a Design System, Now What?
morganepeng
51
7.3k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Raft: Consensus for Rubyists
vanstee
137
6.7k
Statistics for Hackers
jakevdp
796
220k
Site-Speed That Sticks
csswizardry
2
190
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