Slide 1

Slide 1 text

Networking and Service Discovery for all containers runtimes [rkt and Docker] Ilya Dmitrichenko

Slide 2

Slide 2 text

Outline • Intro to rkt • Motivation • why do I need a container network? • why to use Weave Net? • How Weave Net works • comparison to other solutions • Demo (rkt & Docker on GCE + Docker for Mac)

Slide 3

Slide 3 text

I know Docker, what’s rkt? • rkt is a container runtime built by CoreOS • rkt is somewhat less opinionated then Docker • Docker uses runC, which is similar to rkt • rkt has a simpler architecture • rkt is easier to use as a building block • rkt can run Docker images

Slide 4

Slide 4 text

Why do I need a container network? • you may want to use an orchestrator • some orchestrators require a network • options vary, depending on cloud provider • you need something that just works

Slide 5

Slide 5 text

Why chose Weave Net? • works with any orchestrator (or without one) • provides unique IP for each container • has simple service discovery built-in • easy to setup and manage • works with all runtimes, as you will see • works the same in any cloud

Slide 6

Slide 6 text

What do you mean by any orchestrator? • Kubernetes • EC2 Container Service • Docker Swarm • Apache Mesos • DC/OS

Slide 7

Slide 7 text

How does Weave Net work? • lightweight micro-SDN • resilient mesh architecture • uses L2/VXLAN, supports multicast • no external config store required • all state leave on the network

Slide 8

Slide 8 text

How does service discovery work? • fast in-memory DNS • simply find containers by name • no port number lookup • no port remapping • no code changes

Slide 9

Slide 9 text

How does it compare? • using client-side lookup is not easy to implement and hard to debug • SRV record or directory lookup • e.g.: Consul, Zookeeper, etcd • wrapping service discovery into proxy config is not optimal and even harder to debug • e.g.: multitude of bespoke code on Github

Slide 10

Slide 10 text

Step 1: Infrastructure Setup Let's say you'd like to have a cluster of 3 hosts with Docker installed • $CONTAINERS_1, $CONTAINERS_2, $CONTAINERS_3

Slide 11

Slide 11 text

Step 2: Install Weave Net On all of the machines run: sudo curl --location --silent git.io/weave \ --output /usr/local/bin/weave sudo chmod +x /usr/local/bin/weave

Slide 12

Slide 12 text

Step 3: Launch Weave Net On all of the machines run: weave launch \ $CONTAINERS_1 $CONTAINERS_2 $CONTAINERS_3 eval $(weave env)

Slide 13

Slide 13 text

Step 3: Run your apps On each hosts run these commands on any host: docker run -d \ —-name=svc-a image docker run -d \ —-name=svc-b image docker run -d alpine ping -c3 svc-a docker run -d alpine ping -c3 scc-b

Slide 14

Slide 14 text

And what about rkt?

Slide 15

Slide 15 text

Live Demo!

Slide 16

Slide 16 text

How can I use it with Kubernetes?

Slide 17

Slide 17 text

How can I use it with Kubernetes? git.io/k8s-anywhere

Slide 18

Slide 18 text

@errordeveloper