Slide 1

Slide 1 text

OK for infrastructure beginners! Picture-story Kubernetes Aoi

Slide 2

Slide 2 text

Self Introduction Name: Aoi Work as software engineer at Cybozu twitter: @_a0i

Slide 3

Slide 3 text

First What I am going to speak ● Abstracts and consideration about Kubernetes Not speak about ● Description about Docker and containers ● How to useKubernetes

Slide 4

Slide 4 text

Episode 1:Here Comes Kubernetes!   Why Kubernetes was created Episode 2:Kubernetes and the Days   Deployment flow for Kubernetes Episode 3:And the Journy Continues   Mechanisms to keep running Kubernetes 目次

Slide 5

Slide 5 text

Here Comes Kubernetes!

Slide 6

Slide 6 text

There was a big Java application Once Upon a Time...

Slide 7

Slide 7 text

There Were No Problems in the Beginning But... A failure in one place affects the whole takes time to start takes time to release

Slide 8

Slide 8 text

The Developers Thought...

Slide 9

Slide 9 text

Let’s Use Containers to Make Our Applications Smaller!

Slide 10

Slide 10 text

But That Doesn't Make the Challenge Go Away. Hard to detect a failure and bring the container back up. Which server did I deploy the container? Where should I deploy the container?

Slide 11

Slide 11 text

Hey It's me Kubernetes

Slide 12

Slide 12 text

What Makes You Happy When You Use a Container? ・Containers are faster to boot than virtual machines. ・Applications are isolated in containers, which is convenient. On the other hand, containers become disorganized and difficult to manage.

Slide 13

Slide 13 text

App Guest OS Host OS Hardware Virtual Machine Container Hypervisor Guest OS Middle ware Middle ware App App App App App App App Middle ware Middle ware Hardware Host OS Container Runtime

Slide 14

Slide 14 text

What is Kubernetes? Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. (From Kubernetes Document https://kubernetes.io/docs/concepts/overvie w/what-is-kubernetes/)

Slide 15

Slide 15 text

1. Implement “Infrastructure As Code” through the use of resource configuration files called manifests 2. Standardized and abstracted by Kubernetes API, no need to know server-specific settings 3. Reconciliation Loop Kubernetes Makes Container Operations Convenient

Slide 16

Slide 16 text

apiVersion: v1 kind: Pod metadata: name: nginx spec: containers: - name: test image: nginx:1.14.2 resources: requests: memory: "100Mi" Example of manifest:nginx container Which server to deploy? What Operating System to use?Specification of the server memory? No need to worry!

Slide 17

Slide 17 text

Reconciliation Loop Want two container OK!

Slide 18

Slide 18 text

Reconciliation Loop Nooooooooo oh

Slide 19

Slide 19 text

Reconciliation Loop ♪ Here’s two!

Slide 20

Slide 20 text

Kubernetes And The Days

Slide 21

Slide 21 text

Understand that Kubernetes helps operations but...

Slide 22

Slide 22 text

・・・。 How exactly is it useful for developers?

Slide 23

Slide 23 text

Application Development to Date Application Virtual Machine Abstracted for simplicity. Access by Browser! Config files

Slide 24

Slide 24 text

To Develop Using Containers... Connection between containers? App App App Middle ware Middle ware Hardware Host OS Container Runtime How to Access from the outside? How to pass the configuration file? How to use storage?

Slide 25

Slide 25 text

Isn't it Getting Harder?

Slide 26

Slide 26 text

Anyone Calling Me?

Slide 27

Slide 27 text

This is What Happens When You Use Kubernetes! Service Container Container Pod ConfigMap

Slide 28

Slide 28 text

Application Development Using Kubernetes CI Container Registry docker build docker push pull Service

Slide 29

Slide 29 text

Application Development Using Kubernetes CI Container Registry docker build docker push pull Service manifest kubectl apply

Slide 30

Slide 30 text

Is it Good to manually kubectl apply each time? kubectl apply kubectl apply How do you manage it? When to apply? Which environment to apply it to?

Slide 31

Slide 31 text

CIOps push kick Manifest Repository CI Tool

Slide 32

Slide 32 text

GitOps push pull Manifest Repository Deploy Tool

Slide 33

Slide 33 text

Difference? CIOps:Push-based model. It is easy to understand and intuitive because it automates what kubectl apply does. GitOps:Pull-based model. Because it is declarative, the managed manifest is always the correct configuration.

Slide 34

Slide 34 text

Kubernetes Architecture kube- apiserver etcd controller manager kubelet kube- proxy kubectl kube- scheduler Control Plane Node Node kubelet kube- proxy

Slide 35

Slide 35 text

And the Journy Continues

Slide 36

Slide 36 text

One night, the container seems to have gone bad... What do we do now?

Slide 37

Slide 37 text

I'll Take Care!

Slide 38

Slide 38 text

Various Health Check Mechanisms Remove non-healthy pods from services Create a new pod Service Service

Slide 39

Slide 39 text

Move resources to another Node automatically. In Case of Node failure...

Slide 40

Slide 40 text

Still, Failures Happen: Examples from Other Companies Deleting a cluster in the production environment (Spotify) Cleanup process removes Docker images from production environment (Airbnb)

Slide 41

Slide 41 text

● No matter how good Kubernetes is, failures will occur. ● “Logging in to a VM, checking it with ps or systemctl, and looking at the log file" is no longer an option. Log! Metrics! Alert! Important! Observability

Slide 42

Slide 42 text

Let's Enjoy Kubernetes!

Slide 43

Slide 43 text

Reference Kubernetesとは何か? https://kubernetes.io/ja/docs/concepts/overview/what-is-kubernetes/ Using Pods https://kubernetes.io/docs/concepts/workloads/pods/#using-pods 10 More Weird Ways to Blow Up Your Kubernetes - Jian Cheung & Joseph Kim, Airbnb https://www.youtube.com/watch?v=4CT0cI62YHk Keynote: How Spotify Accidentally Deleted All its Kube Clusters with No User Impact - David Xia https://www.youtube.com/watch?v=ix0Tw8uinWs Kubernetes Failure Stories https://k8s.af