Docker meets Kubernetes - Linux-Magazin · 2017-03-23 · Docker meets Kubernetes ... version= v1...
Transcript of Docker meets Kubernetes - Linux-Magazin · 2017-03-23 · Docker meets Kubernetes ... version= v1...
Docker meets KubernetesSebastianScheele
What is this Docker thing?
• Acompany?
• Aformat?
• AnAPI?
Basic Docker components
3
Kubernetes
4
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
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
Kubelet Kubelet Kubelet
Kubernetes Master
Scheduler
API Server
Start with a Cluster
Theatomofscheduling forcontainers
Representsanapplicationspecificlogicalhost
Hostscontainers andvolumes
Eachhasitsownroutable(noNAT)IPaddress
Ephemeral• Podsare functionallyidenticalandtherefore
ephemeralandreplaceablePod
WebServer
Volume
Consumers
A pod of whales containers
Pods
Pod
GitSynchronizer
Node.jsAppContainer
Volume
ConsumersgitRepoCanbeusedtogroupmultiplecontainers&sharedvolumes
Containerswithinapodare tightly coupled
Sharednamespaces• ContainersinapodshareIP,portandIPC
namespaces• Containersinapodtalktoeachotherthrough
localhost
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
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
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
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
DEMO
14
What is
• ManagedKubernetesclusterfordatacenter,readytouse
• Distributionindependent• Out-of-the-boxprivateregistry• Regularlyscheduledupdates• Ticketandphonesupport• GuidanceforKubernetes,Docker,systemarchitectureandDevOps
16
www.containerdays.de
Thank youwww.loodse.com
@Loodse
github.com/loodse/