consul
This commit is contained in:
parent
0d192da290
commit
84a9b23676
1 changed files with 72 additions and 0 deletions
72
swarm/consul.yaml
Normal file
72
swarm/consul.yaml
Normal file
|
|
@ -0,0 +1,72 @@
|
||||||
|
|
||||||
|
networks:
|
||||||
|
netgrimoire:
|
||||||
|
external: true
|
||||||
|
|
||||||
|
services:
|
||||||
|
consul-server:
|
||||||
|
image: consul:latest
|
||||||
|
hostname: "consul-{{.Task.Slot}}"
|
||||||
|
command: >
|
||||||
|
agent -server
|
||||||
|
-bootstrap-expect=3
|
||||||
|
-ui
|
||||||
|
-client=0.0.0.0
|
||||||
|
-bind='{{ GetInterfaceIP "eth0" }}'
|
||||||
|
-retry-join=tasks.consul-server
|
||||||
|
-datacenter=netgrimoire
|
||||||
|
ports:
|
||||||
|
- target: 8500
|
||||||
|
published: 8500
|
||||||
|
protocol: tcp
|
||||||
|
mode: host
|
||||||
|
- target: 8600
|
||||||
|
published: 8600
|
||||||
|
protocol: udp
|
||||||
|
mode: host
|
||||||
|
- target: 8600
|
||||||
|
published: 8600
|
||||||
|
protocol: tcp
|
||||||
|
mode: host
|
||||||
|
networks:
|
||||||
|
- netgrimoire
|
||||||
|
volumes:
|
||||||
|
- consul-data:/consul/data
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
replicas: 3 # Changed from 1 to 3
|
||||||
|
placement:
|
||||||
|
constraints:
|
||||||
|
- node.role == manager
|
||||||
|
max_replicas_per_node: 1
|
||||||
|
restart_policy:
|
||||||
|
condition: any
|
||||||
|
delay: 5s
|
||||||
|
max_attempts: 3
|
||||||
|
window: 120s
|
||||||
|
update_config:
|
||||||
|
parallelism: 1
|
||||||
|
delay: 30s
|
||||||
|
|
||||||
|
registrator:
|
||||||
|
image: gliderlabs/registrator:latest
|
||||||
|
command: >
|
||||||
|
-internal
|
||||||
|
-retry-attempts=10
|
||||||
|
-retry-interval=2000
|
||||||
|
consul://tasks.consul-server:8500
|
||||||
|
volumes:
|
||||||
|
- /var/run/docker.sock:/tmp/docker.sock
|
||||||
|
networks:
|
||||||
|
- netgrimoire
|
||||||
|
depends_on:
|
||||||
|
- consul-server
|
||||||
|
deploy:
|
||||||
|
mode: global # Runs on ALL 6 nodes
|
||||||
|
restart_policy:
|
||||||
|
condition: any
|
||||||
|
delay: 5s
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
consul-data:
|
||||||
|
driver: local
|
||||||
Loading…
Add table
Add a link
Reference in a new issue