Slide 1

Slide 1 text

Don't go the hard way with containers! Ilya Dmitrichenko @errordeveloper

Slide 2

Slide 2 text

Docker defines a unit of deployment

Slide 3

Slide 3 text

Weave Net provides robust and simple connectivity for your containers

Slide 4

Slide 4 text

NGINX+ supports DNS, but how to you use it?

Slide 5

Slide 5 text

$ORIGIN example.com $TTL 86400 @ IN SOA dns1.example.com. hostmaster.example.com. ( 2001062501 ; serial 21600 ; refresh after 6 hours 3600 ; retry after 1 hour 604800 ; expire after 1 week 86400 ) ; minimum TTL of 1 day IN NS dns1.example.com. IN NS dns2.example.com. IN MX 10 mail.example.com. IN MX 20 mail2.example.com. IN A 10.0.1.5 server1 IN A 10.0.1.5 server2 IN A 10.0.1.7 dns1 IN A 10.0.1.2 dns2 IN A 10.0.1.3 ftp IN CNAME server1 mail IN CNAME server1 mail2 IN CNAME server2 www IN CNAME server2

Slide 6

Slide 6 text

642 pages ($49.99)

Slide 7

Slide 7 text

upstream { upstream myapp_backends { zone myapp_backends 64k; server myapp.weave.local resolve; } } server { listen 80 default_server; location / { proxy_pass http://myapp_backends; } }

Slide 8

Slide 8 text

docker run \ -h app.weave.local \ myapp Run any number of app instances on any host in Weave Net cluster!

Slide 9

Slide 9 text

Can I run Elasticsearch on Docker out-of-the-box? • Yes, there is an official image: > docker run -d elasticsearch

Slide 10

Slide 10 text

…and what about clustering? • I don’t see how to do it with the official image, but there seems to be another one by @itgz > docker run -d \ -p 9200:9200 -p 9300:9300 itzg/elasticsearch > docker run -d \ -p 9200:9201 -p 9300:9301 itzg/elasticsearch > docker run -d \ -p 9200:9202 -p 9300:9302 itzg/elasticsearch • That’s not “official”, right?

Slide 11

Slide 11 text

I am still not sure how clustering will work ;’( • What are `-p 9200:9201 -p 9300:9301`? • How do I run the instances on different hosts? • Which port should my client use? • What is the “ambassador patter”? • May be I need a kind of orchestrator tool?

Slide 12

Slide 12 text

I found a few examples of what others did… • Mesos + HAProxy + Marathon + Ansible • This one uses Ubuntu in EC2 and I really should be using RedHat in Azure, I am also not sure about switching to Ansible from Puppet, and still need to learn more about all the Mesos stuff… • CoreOS + fleet + etcd • I like the idea of CoreOS, but not sure if my boss likes it and, it still looks a bit complicated… • Kubernetes • Looks also interesting, but I am not sure we can introduce Kubernetes either… I just want to demo proof-of-concept next week

Slide 13

Slide 13 text

Introducing Weave • Easiest way to build portable Docker app clusters • You won't have to change your app • Lean service discovery which doesn't in your way • Simple to use on its own or with an orchestrator

Slide 14

Slide 14 text

Service Discovery var es = new elasticsearch.Client({ hosts: [ 'es-1.weave.local:9200' , 'es-2.weave.local:9200' , 'es-3.weave.local:9200' ] });

Slide 15

Slide 15 text

Demo • 3 VMs, each of these runs • an instance of Elasticsearch • 2 instances of a RESTful app • NGINX+ load-balancing all 6 instances github.com/errordeveloper/weave-demos/blob/master/hello-apps/elasticsearch-js/tldr.md

Slide 16

Slide 16 text

Find out more at weave.works