Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
HashiCorp Consul
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Heraud Kevin
May 18, 2017
Technology
25
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
HashiCorp Consul
Heraud Kevin
May 18, 2017
Transcript
31 slides
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
More Decks by Heraud Kevin
See All by Heraud Kevin
WebAssembly
aicfr
0
57
Cross Browser Testing
aicfr
0
33
Certificate pinning
aicfr
0
57
Frida : Dynamic instrumentation toolkit
aicfr
0
43
GraphQL
aicfr
0
22
Serverless
aicfr
0
24
Hyperledger Composer
aicfr
0
28
HashiCorp Vault
aicfr
0
28
CDI
aicfr
0
37
Other Decks in Technology
See All in Technology
Kansai WordPress Meetup@大阪『ブロックテーマを作る上で知っておくべきこと
torounit
0
260
目を覚ませ!僕らの認証情報が何者かに侵略されてるぞ
tkito
2
480
DevOps Agentにあらゆるセキュリティインシデントのトリアージを任せた件
jirtosterone
1
190
AI-Ready なデータ基盤ってなに? & 新卒未経験が、いま考えていること
imuta
0
1k
認知の質も文化醸成も。数年取り組んで見えてきた技術広報のKPI設計 / Tech PR KPIs: Lessons on Awareness Quality and Culture After Several Years
bitkey
PRO
0
140
攻撃と守りは何が変わり、何が変わらないのか~最近の不正アクセスから考える、リスク評価と標準の使いどころ
oidfj
2
260
[関西Kaggler会 20261113] 続・コミュニティコンペのススメ
nejumi
0
150
市販IoT機器や自作IoT機器とHomeAssistantを駆使して家の電気代をできる限り見える化する方法の考案
harutiro
0
400
人の努力に頼らないセキュリティをエンジニアリングする在り方 / An approach to engineering security that does not rely on human effort
carta_engineering
0
230
Gov-JAWS#9 統合監視機能のマネージドサービス化+AIによる障害時自動調査
fj_yoshimura_kosuke
0
220
Amazon Bedrock AgentCore の基礎とセキュリティ・ガバナンス
ren8k
0
210
マネジメントされる側の仕事は「文句」を言うこと
riyaamemiya
7
5.9k
Featured
See All Featured
30 Presentation Tips
portentint
PRO
1
470
The Curious Case for Waylosing
cassininazir
1
620
ラッコキーワード サービス紹介資料
rakko
5
6M
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.2k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Designing for Performance
lara
612
70k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Deep Space Network (abreviated)
tonyrice
0
420
Technical Leadership for Architectural Decision Making
baasie
4
650
Well, that’s weird…
csswizardry
1
130
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.6k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k