Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster...

17
Docker meets Kubernetes Sebastian Scheele

Transcript of Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster...

Page 1: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Docker meets KubernetesSebastianScheele

Page 2: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

What is this Docker thing?

• Acompany?

• Aformat?

• AnAPI?

Page 3: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Basic Docker components

3

Page 4: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Kubernetes

4

Page 5: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Kube what?

Greekfor“Helmsman”

• Containers@Google

• Borghttp://www.infoq.com/news/2015/04/google-borg

• Omega

• Opensource 6/2014• Google(K)ontainer Engine(GKE)• 100%written ingolang

5

Page 6: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Start with a Cluster

Laptop tohigh-availabilitymulti-nodecluster

Hosted orselfmanaged

On-Premise orCloud

BareMetal orVirtualMachines

MostOSes (inc. RedHatAtomic,Fedora,CentOS)

OrjustabunchofRaspberryPIs

Manyoptions,SeeMatrixfordetails

KubernetesClusterMatrix:http://bit.ly/1MmhpMW6

Page 7: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Kubelet Kubelet Kubelet

Kubernetes Master

Scheduler

API Server

Start with a Cluster

Page 8: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Theatomofscheduling forcontainers

Representsanapplicationspecificlogicalhost

Hostscontainers andvolumes

Eachhasitsownroutable(noNAT)IPaddress

Ephemeral• Podsare functionallyidenticalandtherefore

ephemeralandreplaceablePod

WebServer

Volume

Consumers

A pod of whales containers

Page 9: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Pods

Pod

GitSynchronizer

Node.jsAppContainer

Volume

ConsumersgitRepoCanbeusedtogroupmultiplecontainers&sharedvolumes

Containerswithinapodare tightly coupled

Sharednamespaces• ContainersinapodshareIP,portandIPC

namespaces• Containersinapodtalktoeachotherthrough

localhost

Page 10: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

PodshaveIPswhichareroutable

PodscanreacheachotherwithoutNAT

Evenacrossnodes

NoBrokeringofPortNumbers

Thesearefundamentalrequirements

Manysolutions

Flannel,Weave,OpenVSwitch,CloudProvider

Pod Networking (across nodes)

10.1.2.0/24

10.1.1.0/24

10.1.1.211 10.1.1.2

10.1.2.106

10.1.3.0/24

10.1.3.4510.1.3.17

10.1.3.0/24

Page 11: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Client

Pod

Container

Pod

Container

Pod

ContainerContainer

Alogicalgrouping ofpods thatperformthesamefunction• groupedbylabel selector

Loadbalancesincoming requestsacrossconstituentpods

Choiceofpodisrandombutsupports sessionaffinity(ClientIP)

Getsastable virtualIPandport• alsoaDNSnametype =FE

Services

Service

Labelselector:type=FE

VIP

type=FE type=FE type=FE

Page 12: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

ReplicationController Pod Pod

frontend

Pod

frontend

Pod Pod

ReplicationController

#pods=1version=v2

show:version=v2

version=v1 version=v1 version=v2

ReplicationController

#pods=2version=v1

show:version=v2Behavior Benefits

● KeepsPodsrunning

● GivesdirectcontrolofPods

● GroupedbyLabelSelector

➔ RecreatesPods,maintainsdesiredstate

➔ Fine-grainedcontrolforscaling

➔ Standardgroupingsemantics

Replication Controllers

Page 13: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Replication ControllersReplicationController

ReplicationController- Name=“backend”- Selector={“name”:“backend”}- Template={...}- NumReplicas=4

APIServer

3

Start1more

OK 4

Howmany?

Howmany?

Canonicalexampleofcontrolloops

Haveonejob:ensureNcopiesofapod• iftoofew,startnewones• iftoomany,killsome• group==selector

Replicatedpodsarefungible• Noimpliedorderoridentity

Page 14: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

DEMO

14

Page 15: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

What is

• ManagedKubernetesclusterfordatacenter,readytouse

• Distributionindependent• Out-of-the-boxprivateregistry• Regularlyscheduledupdates• Ticketandphonesupport• GuidanceforKubernetes,Docker,systemarchitectureandDevOps

Page 16: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

16

www.containerdays.de

Page 17: Docker meets Kubernetes - Linux-Magazin€¦ · • 100% written in golang 5. Start with a Cluster Laptop to high-availability multi-node cluster Hostedor self managed On-Premiseor

Thank youwww.loodse.com

@Loodse

github.com/loodse/