Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Mesos + Consul = Developer Happiness
Search
Brian Hicks
July 09, 2015
Programming
3
920
Mesos + Consul = Developer Happiness
Talk given to the Denver Mesos Usergroup on July 9th, 2015
Brian Hicks
July 09, 2015
Tweet
Share
More Decks by Brian Hicks
See All by Brian Hicks
Esperanto
brianhicks
0
120
Snake Snacks: Function Composition, The Dumb Way
brianhicks
0
97
Make Snacks: Yet Another JavaScript Build System
brianhicks
0
68
State of Elm 2017
brianhicks
1
480
µKanren: A Minimal Functional Core for Relational Programming
brianhicks
0
390
Terraform All The Things!
brianhicks
2
340
Kubernetes for the Mesos User
brianhicks
1
92
ch-ch-ch-ch-changes in Elm 0.17.0
brianhicks
2
1.8k
State of Elm 2016
brianhicks
3
490
Other Decks in Programming
See All in Programming
EMになってからチームの成果を最大化するために取り組んだこと/ Maximize team performance as EM
nashiusagi
0
100
シェーダーで魅せるMapLibreの動的ラスタータイル
satoshi7190
1
480
Enabling DevOps and Team Topologies Through Architecture: Architecting for Fast Flow
cer
PRO
0
340
OSSで起業してもうすぐ10年 / Open Source Conference 2024 Shimane
furukawayasuto
0
110
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.2k
Ethereum_.pdf
nekomatu
0
470
RubyLSPのマルチバイト文字対応
notfounds
0
120
subpath importsで始めるモック生活
10tera
0
310
C++でシェーダを書く
fadis
6
4.1k
色々なIaCツールを実際に触って比較してみる
iriikeita
0
330
AWS Lambdaから始まった Serverlessの「熱」とキャリアパス / It started with AWS Lambda Serverless “fever” and career path
seike460
PRO
1
260
CSC509 Lecture 13
javiergs
PRO
0
110
Featured
See All Featured
5 minutes of I Can Smell Your CMS
philhawksworth
202
19k
Java REST API Framework Comparison - PWX 2021
mraible
PRO
28
8.2k
It's Worth the Effort
3n
183
27k
A better future with KSS
kneath
238
17k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2.1k
Art, The Web, and Tiny UX
lynnandtonic
297
20k
The Language of Interfaces
destraynor
154
24k
Fireside Chat
paigeccino
34
3k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Designing for humans not robots
tammielis
250
25k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
229
52k
The Art of Programming - Codeland 2020
erikaheidi
52
13k
Transcript
Mesos+Consul= Developer Happiness
Brian Hicks @brianhicks
None
None
OXY HAPROXY client SERVER
marathon-consul haproxy-Consul
Service discovery and configuration made easy. Distributed, highly available, and
datacenter-aware. consul.io
(and DNS) SERVICES
[{ "Address": "10.0.113.214", "Node": "batman-control-01", "ServiceAddress": "", "ServiceID": "marathon", "ServiceName":
"marathon", "ServicePort": 18080, "ServiceTags": ["marathon"] }] curl localhost:8500/v1/catalog/service/marathon Query a Service over HTTP
216.58.216.206 dig +short www.google.com DNS
10.0.113.214 10.0.220.54 10.0.131.25 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. dig +short marathon.service.consul dig +short marathon.service.consul SRV SRV Records
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
{ "name": "marathon", "tags": [ "marathon", "dc-denver" ], "port": 18080,
"check": { "script": "curl http://127.0.0.1:18080/ping", "interval": "10s" } } Service Definition
curl http://localhost:8500/v1/agent/service/register \ -d @marathon.json REgistering the Service
& Q A
and Values) (and Values) Keys
true [{ "CreateIndex": 223, "Flags": 0, "Key": "hello", "LockIndex": 0,
"ModifyIndex": 223, "Value": "d29ybGQ=" }] curl -X PUT -d world http://localhost:8500/v1/kv/hello curl -X GET http://localhost:8500/v1/kv/hello Setting and Retrieving
true false curl -X PUT -d denver http://localhost:8500/v1/kv/hello?cas=223 curl -X
PUT -d world http://localhost:8500/v1/kv/hello?cas=1 Check and Set
WAtches HTTP/1.1 200 OK Content-Type: application/json X-Consul-Index: 226 X-Consul-Knownleader: true
X-Consul-Lastcontact: 0 Date: Mon, 29 Jun 2015 16:25:45 GMT Content-Length: 96 curl http://localhost:8500/v1/kv/hello?index=226
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
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}}
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}}
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}}
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}}
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}} 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}} Haproxy Template
& Q A
(yes, we're getting a new name) microservices-infrastructure Github.com/CiscoCloud/microservices-infrastructure Microservices infrastructure
is a modern platform for rapidly deploying globally distributed services
Components
@brianhicks //
[email protected]
@ASteris_LLC //
[email protected]
Colophon Eggs. Plenty of them. Alex Barth, Licensed CC BY
2.0 https://www.flickr.com/photos/a-barth/4985481182 Dictionary Greeblie, Licensed CC BY 2.0 https://www.flickr.com/photos/greeblie/3338710223