blob: 18a65346cf52ebb7761a4cf563b4e730bbb91b5c [file] [log] [blame]
Richard Jankowskia1867962017-06-20 13:35:31 -04001version: "3"
2services:
3
4#
5# Deploying a Consul cluster using this file assumes that overlay network 'voltha_net'
6# has already been created. To deploy the cluster, issue the command:
7#
8# docker stack deploy -c docker-compose-consul-cluster.yml consul
9#
10# This command will create overlay network 'consul_net'.
11#
12
13 consul:
14 image: consul:latest
15
16 # Deploy to all docker manager nodes
17 deploy:
18 mode: global
19 placement:
20 constraints:
21 - node.role == manager
22 restart_policy:
23 condition: on-failure
24 environment:
25 CONSUL_LOCAL_CONFIG: "{disable_update_check: true}"
26 CONSUL_BIND_INTERFACE: eth0
27 entrypoint:
28 - consul
29 - agent
30 - -server
31 - -bootstrap-expect=3
32 - -config-dir=/consul/config
33 - -data-dir=/consul/data # mandatory property
34 - -bind={{ GetInterfaceIP "eth0" }}
35 - -client=0.0.0.0
36 - -ui
37 - -retry-join=10.10.10.2
38 - -retry-join=10.10.10.3
39 - -retry-join=10.10.10.4
40 - -retry-join=10.10.10.5
41 - -retry-join=10.10.10.6
42 - -retry-join=10.10.10.7
43 networks:
44 - net
45 - voltha-net
46 ports:
47 - "8300:8300"
48 - "8400:8400"
49 - "8500:8500"
50 - "8600:8600/udp"
51
52networks:
53 net:
54 driver: overlay
schowdhuryd9084962017-06-21 14:51:49 -070055 driver_opts:
56 encrypted: "true"
Richard Jankowskia1867962017-06-20 13:35:31 -040057 ipam:
58 driver: default
59 config:
60 - subnet: 10.10.10.0/29
61 voltha-net:
62 external:
63 name: voltha_net
64