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
HashiCorp Consul
Search
Heraud Kevin
May 18, 2017
Technology
19
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HashiCorp Consul
Heraud Kevin
May 18, 2017
More Decks by Heraud Kevin
See All by Heraud Kevin
WebAssembly
aicfr
0
46
Cross Browser Testing
aicfr
0
25
Certificate pinning
aicfr
0
46
Frida : Dynamic instrumentation toolkit
aicfr
0
25
GraphQL
aicfr
0
14
Serverless
aicfr
0
17
Hyperledger Composer
aicfr
0
17
HashiCorp Vault
aicfr
0
24
CDI
aicfr
0
29
Other Decks in Technology
See All in Technology
機械学習を「社会実装」するということ 2026年夏版 / Social Implementation of Machine Learning June 2026 Version
moepy_stats
2
540
[モダンアプリ勉強会]今更聞けないGit/GitHub入門
tsukuboshi
0
310
Amazon Bedrock AgentCore ワークショップ JAWS UG TOHOKU / amazon-bedrock-agentcore-workshop-jawsug-tohoku-2026
gawa
9
510
サイバーセキュリティ概論 / Introduction to Cybersecurity
ks91
PRO
0
170
AIの性能が向上しても未解決な組織の重大問題は何か?/An Unsolved Organizational Problem in the Age of AI
moriyuya
3
500
React、まだ楽しくて草
uhyo
7
4.2k
ChatworkとBPaaS 異なる特性で学んだAI機能開発の ベストプラクティス
kubell_hr
2
3.3k
AI Adaptable なテストを整える工夫 / Ways to Make Your Tests AI-Adaptable
bitkey
PRO
3
230
TypeScript Compiler APIとPHP-Parserを活用し、TypeScriptとPHPで型を共有する
shuta13
0
370
AmazonRoute 53ではじめてのドメイン取得!HTTPS化までの道のりを整理してみた
usanchuu
3
120
関西に縁あるMicrosoft MVPsが語るCopilotの未来
kasada
0
1.2k
社内 AI エージェント Synapse と セマンティックレイヤーの育て方
hiroakis
1
1.1k
Featured
See All Featured
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
360
GitHub's CSS Performance
jonrohan
1033
470k
The World Runs on Bad Software
bkeepers
PRO
72
12k
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
190
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
First, design no harm
axbom
PRO
2
1.2k
Embracing the Ebb and Flow
colly
88
5.1k
Facilitating Awesome Meetings
lara
57
6.9k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
122
22k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
290
Build your cross-platform service in a week with App Engine
jlugia
234
18k
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
1
160
Transcript
None
Déployer, « scaler » et configurer une application avec Consul
(et docker, consul-template, envconsul, HAProxy, python, …)
None
None
None
None
Provision, secure, and run any infrastructure for any application.
None
Caractéristiques principales Service Discovery (DNS/HTTP) Multi Datacenter KV Storage Failure
Detection + ACL + Web UI + Evènements distribués + « watch » + Métriques / Monitoring + …
Consul = DNS server + etcd + ZooKeeper + Nagios
+ Web UI + …
None
Enregistrement d’un service $ curl \ --request PUT \ --data
@payload.json \ https://consul:8500/v1/agent/service/register { "service": { "id": "api-1", "name": "api", "tags": ["demo"], "address": "127.0.0.1", "port": 5000, "checks": { "name": "Health api", "http": "http://127.0.0.1:5000/api/health", "interval": "10s" } } }
Enregistrement d’un service Ecwid/consul-api OrbitzWorldwide/consul-client gliderlabs/registrator cfg4j kdlan/jconsul
Enregistrement d’un service • SERVICE_5000_NAME=api • SERVICE_CHECK_HTTP=/api/health • SERVICE_CHECK_INTERVAL=15s
Architecture (HA) Gossip protocol : SWIM (Hashicorp Serf) Consensus Protocol
: Raft • Si le client est hors ligne, une seule instance de l’application y sera également • L’application n’a besoin de connaitre qu’une seule adresse : 127.0.0.1:8600
DNS lookup [tag.]<service>.service[.datacenter].<domain> $ dig SRV api.service.consul ; <<>> DiG
9.10.4-P3 <<>> SRV api.service.consul ;; global options: +cmd ;; Got answer: ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 52880 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1 ;; QUESTION SECTION: ;api.service.consul. IN SRV ;; ANSWER SECTION: api.service.consul. 0 IN SRV 1 1 5000 consul.node.dc1.consul. ;; ADDITIONAL SECTION: consul.node.dc1.consul. 0 IN A 10.0.2.15 ;; Query time: 1 msec ;; SERVER: 10.0.2.15#53(10.0.2.15) ;; WHEN: Thu May 11 13:16:55 UTC 2017 ;; MSG SIZE rcvd: 88
Ajout d’un service --name api-node-1 -P app flask run --host=0.0.0.0
--name api-node-2 -P app flask run --host=0.0.0.0
SRV _service._proto.name. TTL class SRV priority weight port target. Ribbon/Feign
spotify/dns-java
• « Templating » • Rechargement au changement • Intégration
universelle (HAProxy, nginx, …) +
Consul-template + HAProxy
Consul-template {{ range services }} backend {{ .Name }}_backend {{
range service .Name }} server {{ .Node }}-{{ .Port }} {{ .Address }}:{{ .Port }}{{ end }} {{ end }} {{ range services }} acl host_{{ .Name }} hdr_beg(host) -i {{ .Name }}."haproxy.service.consul" use_backend {{ .Name }}_backend if host_{{ .Name }} {{ end }}
Alternatives gliderlabs/connectable 3fs/consul-f5 Consul et IPTables
#cfgfilesless KV Storage
KV Storage (HTTP API) $ curl -X PUT \ -d
50000 \ http://consul:8500/v1/kv/global/config/hazelcast/client/connection_timeout true $ curl http://consul:8500/v1/kv/global/config/hazelcast/client/connection_timeout?raw 50000
KV Storage Ecwid/consul-api OrbitzWorldwide/consul-client cfg4j Magnetme/consultant kdlan/jconsul archaius Library for
configuration management API
III. Configuration Stockez la configuration dans l’environnement https://12factor.net/fr/config envconsul
envconsul $ envconsul -prefix service/$OBJECT_CODE/$ENV -config="/app/config.hcl" flask run --host=0.0.0.0
Script + Interval HTTP + Interval TCP + Interval Time
to Live (TTL) Docker + Interval Failure Detection
Consul watch
Consul watch $ consul watch -type checks -service api /consul/check.sh
None