-
Notifications
You must be signed in to change notification settings - Fork 0
/
consul_cluster_compose.yaml
78 lines (71 loc) · 1.64 KB
/
consul_cluster_compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
version: '3.3'
#customise this with options from
#https://www.consul.io/docs/agent/options.html
services:
consul_seed:
hostname: consul_seed
image: consul:0.9.3
deploy:
replicas: 1
environment:
- "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}"
- "CONSUL_BIND_INTERFACE=eth0"
entrypoint:
- consul
- agent
- -server
- -bootstrap-expect=3
- -data-dir=/tmp/consuldata
- -bind={{ GetInterfaceIP "eth0" }}
networks:
- "consul"
volumes:
- consul_seed:/tmp/consuldata
consul_cluster:
image: consul:0.9.3
depends_on:
- consul_seed
deploy:
replicas: 2
mode: replicated
environment:
- "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}"
- "CONSUL_BIND_INTERFACE=eth0"
- "CONSUL_HTTP_ADDR=0.0.0.0"
entrypoint:
- consul
- agent
- -server
- -data-dir=/tmp/consuldata
- -bind={{ GetInterfaceIP "eth0" }}
- -retry-join=consul_seed:8301
- -bootstrap-expect=3
networks:
- "consul"
consul_clients:
image: consul:0.9.3
depends_on:
- consul_seed
deploy:
mode: global
environment:
- "CONSUL_LOCAL_CONFIG={\"disable_update_check\": true}"
- "CONSUL_BIND_INTERFACE=eth2"
- "CONSUL_HTTP_ADDR=0.0.0.0"
entrypoint:
- consul
- agent
- -ui
- -data-dir=/tmp/consuldata
- -bind={{ GetInterfaceIP "eth2" }}
- -client=0.0.0.0
- -retry-join=consul_seed:8301
networks:
- "consul"
ports:
- 8500:8500
networks:
consul:
driver: overlay
volumes:
consul_seed: