ha kubernetes on mesos / marathon

Post on 21-Jan-2018

275 Views

Category:

Internet

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Docker on Kubernetes

Thank you@planet for the snacks

22seven for the venue

Blue Battleship for the drinks

(^^^ shameless self promotion)

ActuallyDocker on Kubernetes

on Mesos via Marathon

in VirtualBox via Vagrant

Provisioned with Chef

Relax and listenAll the code and commands will

be available online after the talk

What is Docker?According to Google:

person employed in a port to load and unload ships.

Docker containers wrap up a piece of software in a

complete filesystem that contains everything it needs

to run: code, runtime, system tools, system libraries

– anything you can install on a server. This

guarantees that it will always run the same,

regardless of the environment it is running in.

Why is this important?Creates a standard way to ship build artifacts

Ships the exact binary the developer had

<Stock photo for docker presentation>

So you have containersNow what?

Let’s deploy!

Where do you host them?Docker Hub (public, security)

AWS ECR

Private Docker registry

How do you deploy?Command line

High hardware utilizationIdling systems wastes money

Ok, so let’s spin up moreUse each server for multiple services

Forward the ports to the same on host

Put a loadbalancer in front

Pat back, just scaled horizontally

IssuesHow do the nodes in a service discover other ones

to allow them to cluster?

Chef!(My new koolaid driven tool)

Ansible is also cool, ask Tom

Erm, riiiiiiightI’ve heard Mesos/Marathon can help with that

Are we there yet?I thought this talk was about Kubernetes

KubernetesGood for spinning up pods

Registering services

Etcd event -> Update DNS

PodsCollection of Docker images that work together

nginx + memcached

Independent, no shared state

Port inside container is mapped to host port

PodsMortal, when they die, they are gone

Sounds like something should watch them

Replication controllerMonitors the pods

Spins up or kills pods depending

on replication count required

Should be used for single pods

PodsIf the run on some host somewhere,

how do we find them?

ServicesHigher level abstraction

Website doesn’t care which instance,

just looking for image processing service

Has a port to pod port mapping

Port mappingService registers with Etcd -> DNS

Service port -> Pod port -> Container port

Starting to get complicated

myservice.etcd.local

Mesos / MarathonGood with scheduling tasks on nodes

Monitors and restarts processes

Assigns random ports to containers

Allows resource constraints

Consul + nginxConsul raises events when service is registerd

Consul-template -> generate nginx config

Load balance 2x nginx for *.mydomain.com

Mesos + KubernetesEasy, right?

What now?Vagrant + Virtualbox

Chef them

Sounds do-able

VagrantSpin up 3 Ubuntu machines

Provision with Chef

Eth0 vs Eth1Chef Ohai reads eth0

Needs to be eth1

Vagrant Ohai plugin!

Then it broke

Zookeeper

Mesos

MarathonNot too much pain

KubernetesLot’s of pain

Build from source

Build from source using Docker image

Download binary

KubernetesSpecifically didn’t choose to do single master

example, you wouldn’t run it like this in

production

KubernetesWatch Kelsey Hightower’s youtubes

KubernetesReally not so easy to set up as HA

Thank you@planet for the snacks

22seven for the venue

Blue Battleship for the drinks

(^^^ shameless self promotion)

top related