blob: 4a4200c1ef6610cdc149ccdb1f093452065e8e68 [file] [log] [blame]
Richard Jankowskia1867962017-06-20 13:35:31 -04001#
2# Deploying a Consul cluster using this file assumes that overlay network 'voltha_net'
3# has already been created. To deploy the cluster, issue the command:
4#
5# docker stack deploy -c docker-compose-consul-cluster.yml consul
6#
7# This command will create overlay network 'consul_net'.
8#
Richard Jankowski63ce1b42017-08-08 11:31:51 -04009version: "3"
10services:
Richard Jankowskia1867962017-06-20 13:35:31 -040011
12 consul:
13 image: consul:latest
14
15 # Deploy to all docker manager nodes
16 deploy:
khenaidoo0ccef982017-08-02 13:41:13 -040017 replicas: 3
Richard Jankowskia1867962017-06-20 13:35:31 -040018 placement:
19 constraints:
20 - node.role == manager
21 restart_policy:
22 condition: on-failure
23 environment:
24 CONSUL_LOCAL_CONFIG: "{disable_update_check: true}"
25 CONSUL_BIND_INTERFACE: eth0
26 entrypoint:
27 - consul
28 - agent
29 - -server
30 - -bootstrap-expect=3
31 - -config-dir=/consul/config
32 - -data-dir=/consul/data # mandatory property
33 - -bind={{ GetInterfaceIP "eth0" }}
34 - -client=0.0.0.0
35 - -ui
Richard Jankowski63ce1b42017-08-08 11:31:51 -040036 - -retry-join=172.29.20.2
37 - -retry-join=172.29.20.3
38 - -retry-join=172.29.20.4
39 - -retry-join=172.29.20.5
40 - -retry-join=172.29.20.6
41 - -retry-join=172.29.20.7
Richard Jankowskia1867962017-06-20 13:35:31 -040042 networks:
43 - net
44 - voltha-net
45 ports:
46 - "8300:8300"
47 - "8400:8400"
48 - "8500:8500"
49 - "8600:8600/udp"
50
51networks:
52 net:
53 driver: overlay
schowdhuryd9084962017-06-21 14:51:49 -070054 driver_opts:
55 encrypted: "true"
Richard Jankowskia1867962017-06-20 13:35:31 -040056 ipam:
57 driver: default
58 config:
Richard Jankowski63ce1b42017-08-08 11:31:51 -040059 - subnet: 172.29.20.0/29
Richard Jankowskia1867962017-06-20 13:35:31 -040060 voltha-net:
61 external:
62 name: voltha_net
63