Slide 1

Slide 1 text

Mesos + Consul Developer Happiness 1 — Chicago JUG, March 15 2016

Slide 2

Slide 2 text

Hello I'm Brian Hicks I do computer stuff [email protected] // @brianhicks 2 — Chicago JUG, March 15 2016

Slide 3

Slide 3 text

3 — Chicago JUG, March 15 2016

Slide 4

Slide 4 text

Demo 4 — Chicago JUG, March 15 2016

Slide 5

Slide 5 text

Service discovery and configuration made easy. Distributed, highly available, and datacenter- aware. — consul.io 5 — Chicago JUG, March 15 2016

Slide 6

Slide 6 text

Services (and DNS) 6 — Chicago JUG, March 15 2016

Slide 7

Slide 7 text

Query a Service Over HTTP $ curl localhost:8500/v1/catalog/service/marathon [{ "Address": "10.0.113.214", "Node": "batman-control-01", "ServiceAddress": "", "ServiceID": "marathon", "ServiceName": "marathon", "ServicePort": 18080, "ServiceTags": ["marathon"] }] 7 — Chicago JUG, March 15 2016

Slide 8

Slide 8 text

DNS $ dig +short www.google.com 216.58.216.206 8 — Chicago JUG, March 15 2016

Slide 9

Slide 9 text

SRV Records $ dig +short marathon.service.consul 10.0.113.214 10.0.220.54 10.0.131.25 $ dig +short marathon.service.consul SRV 1 1 18080 batman-control-02.node.batman.consul 1 1 18080 batman-control-03.node.batman.consul 1 1 18080 batman-control-01.node.batman.consul 9 — Chicago JUG, March 15 2016

Slide 10

Slide 10 text

Service Definition { "name": "marathon", "tags": [ "marathon", "dc-ord" ], "port": 18080, "check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } 10 — Chicago JUG, March 15 2016

Slide 11

Slide 11 text

Registering the Service $ curl http://localhost:8500/v1/agent/service/register \ -d @marathon.json 11 — Chicago JUG, March 15 2016

Slide 12

Slide 12 text

Q&A 12 — Chicago JUG, March 15 2016

Slide 13

Slide 13 text

K/V Store (AKA configuration) 13 — Chicago JUG, March 15 2016

Slide 14

Slide 14 text

Getting and Setting $ curl -X PUT -d world http://localhost:8500/v1/kv/hello true $ curl -X GET http://localhost:8500/v1/kv/hello [{ "CreateIndex": 223, "Flags": 0, "Key": "hello", "LockIndex": 0, "ModifyIndex": 223, "Value": "d29ybGQ=" }] 14 — Chicago JUG, March 15 2016

Slide 15

Slide 15 text

Check and Set $ curl -X PUT -d chicago http://localhost:8500/v1/kv/hello?cas=223 true $ curl -X PUT -d world http://localhost:8500/v1/kv/hello?cas=1 false 15 — Chicago JUG, March 15 2016

Slide 16

Slide 16 text

Watches HTTP/1.1 200 OK Content-Type: application/json X-Consul-Index: 226 X-Consul-Knownleader: true X-Consul-Lastcontact: 0 Date: Tue, 15 Mar 2016 16:24:45 GMT Content-Length: 96 $ curl http://localhost:8500/v1/kv/hello?index=226 16 — Chicago JUG, March 15 2016

Slide 17

Slide 17 text

Consul-Template This project provides a convenient way to populate values from Consul into the filesystem using the consul-template daemon. — github.com/hashicorp/consul-template 17 — Chicago JUG, March 15 2016

Slide 18

Slide 18 text

Haproxy Template global maxconn {{or (key "service/haproxy/maxconn") 256}} debug defaults mode http timeout connect {{or (key "service/haproxy/timeouts/connect") "5000ms"}} timeout client {{or (key "service/haproxy/timeouts/client") "50000ms"}} timeout server {{or (key "service/haproxy/timeouts/server") "50000ms"}} {{range services}} frontend {{.Name}} bind *:{{key (printf "ports/%s" .Name)}} {{range service .Name}} server {{.Node}} {{.Address}}:{{.Port}}{{end}} {{end}} 18 — Chicago JUG, March 15 2016

Slide 19

Slide 19 text

Q&A 19 — Chicago JUG, March 15 2016

Slide 20

Slide 20 text

Mantl’s ethos is to focus a community around an end to end solution, not around an individual component; designed to solve business and team challenges, one glue, improved by the community, tested everywhere. — mantl.io 20 — Chicago JUG, March 15 2016

Slide 21

Slide 21 text

Thank You! 21 — Chicago JUG, March 15 2016

Slide 22

Slide 22 text

Colophon → White Rabbit by Houser Wolf Licensed CC BY-ND 2.0 → Eggs. Plenty of them. by Alex Barth Licensed CC BY 2.0 → I got that feeling by Josep Ma. Rosell Licensed CC BY 2.0 22 — Chicago JUG, March 15 2016