Slide 1

Slide 1 text

ίϯςφΦʔέετϨʔγϣϯ IBUFOBJOUFSO 

Slide 2

Slide 2 text

ࣗݾ঺հ id:masayosu SRE IBUFOBJOUFSO 

Slide 3

Slide 3 text

͜ͷߨٛͰֶΜͰ΄͍͜͠ͱ Kubernetes Kubernetes IBUFOBJOUFSO 

Slide 4

Slide 4 text

ίϯςφΦʔέετϨʔγϣϯͱ͸ IBUFOBJOUFSO 

Slide 5

Slide 5 text

ίϯςφ Docker: Build/Ship/Run 1 1 1 IBUFOBJOUFSO 

Slide 6

Slide 6 text

ίϯςφΦʔέετϨʔγϣϯͱ͸ 邾丗סؤ٤طػ؅畘杼׊յ⶜鐧׈׎יⳂ־׌ג״סص٭ٜ ˝ ؤ٤طػ⺱㚖ֿ鵟⟓ך׀׾׻ֹמ׌׾ ˝ 舅Ⳃ⴫מ׻׽ؤ٤طػ畘杼ؤتع؅峎׼׌ ˝ 냕ַ⺎榫䓪؅禴䧏׌׾ IBUFOBJOUFSO 

Slide 7

Slide 7 text

ίϯςφΦʔέετϨʔγϣϯπʔϧ͕࣋ͭ ओͳػೳ / / IBUFOBJOUFSO 

Slide 8

Slide 8 text

ίϯςφ഑ஔͷεέδϡʔϦϯά ˝ ؤ٤طػס㲔车丗؅䧗㲊׊յאס丗דׄؤ٤طػ؅玮י׾ ˝ بتطّס靷蕔؅ײיյלסُب٤מؤ٤طػ؅玮י׾־؅舅 Ⳃך鹟䥃׌׾ IBUFOBJOUFSO 

Slide 9

Slide 9 text

ෛՙ෼ࢄ/αʔϏεσΟεΧόϦʔ IP IBUFOBJOUFSO 

Slide 10

Slide 10 text

ηϧϑώʔϦϯά ˝ ُب٤מ꤃㲹ֿ氦榟׊ג㕙⺬ ˝ 塜䅻םُب٤מؤ٤طػ؅鿥糋׊泡׌ ˝ ؤ٤طػמ꤃㲹ֿ氦榟׊ג㕙⺬ ˝ 䑒釐ם⮆דׄؤ٤طػ؅玮י泡׌ ˝ ؤ٤طػ꤃㲹؅吾湳׌׾ג״סىٜتزؘشؠ IBUFOBJOUFSO 

Slide 11

Slide 11 text

ΦʔτεέʔϦϯά ׆׿׼סتآ٭ٛ٤ء؅յ靷蕔敯媲מ䑴׋י舅Ⳃך车ֹ CPU IBUFOBJOUFSO 

Slide 12

Slide 12 text

Kubernetesͱ͸ IBUFOBJOUFSO 

Slide 13

Slide 13 text

Kubernetesͱ͸ kubernetes, k s Google OSS AWS EKS, Google Cloud GKE, Azure AKS IBUFOBJOUFSO 

Slide 14

Slide 14 text

KubernetesͰԿ͕Ͱ͖Δͷ͔ʁ ؤ٤طػ؛٭آتعٝ٭ب٘٤ص٭ٜכ׊י䧏ח׬׀嚀耆؅┉鵟׽⪵נ⤓ֻיַ׾ / / Kubernetes IBUFOBJOUFSO 

Slide 15

Slide 15 text

એݴతͳߏ੒؅ཧ Kubernetes (Manifest) 3 3 2 1 㵚拨氳םסעյ杯敯־׼ס䄐⮆؅⽜♐כ׊י鋗鳭׌׾亠䌋 IBUFOBJOUFSO 

Slide 16

Slide 16 text

Kubernetesͷߏ੒ IBUFOBJOUFSO 

Slide 17

Slide 17 text

Cluster Pod IBUFOBJOUFSO 

Slide 18

Slide 18 text

Node Pod( ) or kubelet API IBUFOBJOUFSO 

Slide 19

Slide 19 text

Pod Pod 1 IBUFOBJOUFSO 

Slide 20

Slide 20 text

αΠυΧʔύλʔϯ pod ( ) Proxy, , IBUFOBJOUFSO 

Slide 21

Slide 21 text

KubernetesͷϦιʔε IBUFOBJOUFSO 

Slide 22

Slide 22 text

ϦιʔεͷΧςΰϦ Workloads Service Con g Storage Cluster Metadata Namespace IBUFOBJOUFSO 

Slide 23

Slide 23 text

WorkloadsΧςΰϦ ؤ٤طػס㲔车מ꞊׌׾ٛخ٭ت Pod Pod IP Replicaset Pod Pod ( ) Pod IBUFOBJOUFSO 

Slide 24

Slide 24 text

WorkloadsΧςΰϦ Deployment Replicaset IBUFOBJOUFSO 

Slide 25

Slide 25 text

WorkloadsΧςΰϦ ♓┖յ☪㍑ס鐐갭ךע⮵榫ם׊ Job CronJob job IBUFOBJOUFSO 

Slide 26

Slide 26 text

ServiceΧςΰϦ Pod Service L Ingress L IBUFOBJOUFSO 

Slide 27

Slide 27 text

kubernetesΫϥελ಺ͷ௨৴ Pod localhost Pod Pod IP pod IP IP Pod IP Pod IP Pod pod IBUFOBJOUFSO 

Slide 28

Slide 28 text

Service ϩʔυόϥϯα Pod ( ) 1 pod 2 pod pod IP ClusterIP ( ) NodePort ( ) LoadBalancer( ) etc IBUFOBJOUFSO 

Slide 29

Slide 29 text

Service αʔϏεσΟεΧόϦ Pod DNS DNS [SERVICE].[NAMESPACE]. [RESOURCE_TYPE].cluster.local DNS A ( ) account.hatena- intern.svc.cluster.local IBUFOBJOUFSO 

Slide 30

Slide 30 text

Ingress Ingress L (AWS ALB, Google Cloud GCLB, Nginx) Ingress HTTPS IBUFOBJOUFSO 

Slide 31

Slide 31 text

Ϧιʔε؅ཧ IBUFOBJOUFSO 

Slide 32

Slide 32 text

Manifest YAML kubectl apply -f k s (yaml) IBUFOBJOUFSO 

Slide 33

Slide 33 text

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 

Slide 34

Slide 34 text

Manifestͷαϯϓϧ(Service) apiVersion: v1 kind: Service metadata: name: nginx-service spec: selector: app: nginx ports: - protocol: TCP port: 80 targetPort: 80 IBUFOBJOUFSO 

Slide 35

Slide 35 text

Ϧιʔε੍ݶ 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 

Slide 36

Slide 36 text

ϔϧενΣοΫ Pod Liveness Probe Pod Readiness Probe Pod Service IBUFOBJOUFSO 

Slide 37

Slide 37 text

Մ༻ੑͱ֦ுੑ IBUFOBJOUFSO 

Slide 38

Slide 38 text

Մ༻ੑ Replicaset Manifest Node Pod Node IBUFOBJOUFSO 

Slide 39

Slide 39 text

ෛՙʹର͢Δ֦ுੑ Horizontal Pod Autoscaler (HPA) CPU Pod Vertical Pod Autoscaler (VPA) CPU, IBUFOBJOUFSO 

Slide 40

Slide 40 text

՝୊Ͱར༻͢Δπʔϧ঺հ IBUFOBJOUFSO 

Slide 41

Slide 41 text

Minikube Kubernetes https://minikube.sigs.k s.io/docs/start/ Kubernetes kind IBUFOBJOUFSO 

Slide 42

Slide 42 text

Kustomize https://github.com/kubernetes-sigs/kustomize k s Dev, Stg, Prd Manifest kustomization.yaml secret con g IBUFOBJOUFSO 

Slide 43

Slide 43 text

Skaffold https://ska old.dev/ k s skaffold.yaml docker IBUFOBJOUFSO 

Slide 44

Slide 44 text

·ͱΊ IBUFOBJOUFSO 

Slide 45

Slide 45 text

Kubernetesͷྑ͍ͱ͜Ζ Pod, Node Cloud Native Computing Fondation(CNCF) https://landscape.cncf.io/ CI/CD GitOps CI/CD Node Pod Spot IBUFOBJOUFSO 

Slide 46

Slide 46 text

Kubernetesͷ೉͍͠ͱ͜Ζ 4 Blue/Green Node IBUFOBJOUFSO 