31
Introduction to Kubernetes Marcin Wielgus DRAFT

Marcin wielgus, introduction to kubernetes

Embed Size (px)

Citation preview

Page 1: Marcin wielgus, introduction to kubernetes

Introduction to Kubernetes

Marcin Wielgus

DRAFT

Page 2: Marcin wielgus, introduction to kubernetes

A little bit of history ...

Page 3: Marcin wielgus, introduction to kubernetes

Slide title here

• Text

image: public domain

Page 4: Marcin wielgus, introduction to kubernetes

gs://kubernetes-release

image: public domain

Page 5: Marcin wielgus, introduction to kubernetes

What does it look now?

Page 6: Marcin wielgus, introduction to kubernetes

Slide title here

• Text

Page 7: Marcin wielgus, introduction to kubernetes

Slide title here

• Text

image: public domain

Page 8: Marcin wielgus, introduction to kubernetes

Slide title here

• Text

image: public domain

Page 9: Marcin wielgus, introduction to kubernetes

Ships

• Ship loading is complicated.

• It can be really time consuming to load and unload a ship, especially with multiple types of goods.

Page 10: Marcin wielgus, introduction to kubernetes

Ships

• Having containers makes loading and unloading much easier and efficient.

• To effectively use containers you need a proper infrastructure.

Page 11: Marcin wielgus, introduction to kubernetes

Slide title here

• Text

Page 12: Marcin wielgus, introduction to kubernetes

Kubernetes

Greek for “Helmsman”; also the root of the words “governor” and “cybernetic”

• Manages container clusters

• Inspired and informed by Google’s experiences and internal systems

• cloud and bare-metal environments

• container runtimes

• 100% Open source, written in Go

Manage applications, not machines

Page 13: Marcin wielgus, introduction to kubernetes

Let’s build something!

Page 14: Marcin wielgus, introduction to kubernetes

Gossip Site

Page 15: Marcin wielgus, introduction to kubernetes

Slide title here

• Text

image: pudelek.pl

Page 16: Marcin wielgus, introduction to kubernetes

What do we need?

• Front-end web servers to show the show the pages.

• Backend servers to perform “business logic”

• Web servers to provide images.• Database with gossips and

discussion boards.• Load Balancer.

Page 17: Marcin wielgus, introduction to kubernetes

Containers and Pods

Web Server

File Puller

Volume10.5.8.123

Pod - a set of container that are run together on the same machine and share volumes, ip address and can communicate via localhost.

Page 18: Marcin wielgus, introduction to kubernetes

Requirements

Container:• CPU, Memory• Volumes• Ports

Pod:• Node preferences• Affinity• Anti-affinity

Page 19: Marcin wielgus, introduction to kubernetes

Scheduling & Controlling

Page 20: Marcin wielgus, introduction to kubernetes

Slide title here

• Text

image: public domain

Page 21: Marcin wielgus, introduction to kubernetes

Kubernetes Architecture

ETCD ApiServer

Scheduler

Controller Manager

Kubelet

SchedulerScheduler

User’s Pod

Kubelet

SchedulerScheduler

User’s Pod

Kubelet

SchedulerScheduler

User Pod

Master NodeWorker node

User requests

Page 22: Marcin wielgus, introduction to kubernetes

Replica Set

Replica Set controller makes sure that there is always the desired number of copies up

Web Serverr

File Puller

Web Serverr

File PullerWeb Server

File Puller

Page 23: Marcin wielgus, introduction to kubernetes

Deployment

Deployment takes care of different versions and rolling updates.

Web Serverr

File Puller

Web Serverr

File PullerWeb Server

File Puller

Web Serverr

File Puller

Web Serverr

File PullerWeb Server

File Puller

Update

Version 1.5Version 1.4

Page 24: Marcin wielgus, introduction to kubernetes

Services

Services make binding set of pods easily.

BackendBackend

Backend

backend.k8s10.5.210.220

BackendBackend

Backend

FrontendFrontend

FrontendFrontend

FrontendFrontend

Page 25: Marcin wielgus, introduction to kubernetes

Ingress

frontend.k8s10.5.210.220

BackendBackend

Frontend

fimages.k8s10.5.211.205

BackendBackend

Images

Load Balancer

gossip.ru/main/*

gossip.ru/images/*

Page 26: Marcin wielgus, introduction to kubernetes

Monitoring and Logging

• Container-level health checks.• Bundled with basic monitoring and

logging solution • Integration with:

• Datadog• ElasticSearch• Influxdb• Prometheus• Splunk• Stackdriver• Sysdig

Page 27: Marcin wielgus, introduction to kubernetes

Autoscaling

Adjusting:• Number of POD to CPU load or

custom metric.• Pod/container declared

requirements to the actual usage.• Number of nodes so that all pods

have place to live and the nodes are well utilized.

Page 28: Marcin wielgus, introduction to kubernetes

What else is in?

Page 29: Marcin wielgus, introduction to kubernetes

State of the Project

~45k Commits ~1100 UniqueContributors

Top 0.001% of all Github Projects

Contributors

Users

Page 30: Marcin wielgus, introduction to kubernetes
Page 31: Marcin wielgus, introduction to kubernetes

Kubernetes

• Text