Richard Jankowski | a186796 | 2017-06-20 13:35:31 -0400 | [diff] [blame] | 1 | # |
| 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 Jankowski | 63ce1b4 | 2017-08-08 11:31:51 -0400 | [diff] [blame] | 9 | version: "3" |
| 10 | services: |
Richard Jankowski | a186796 | 2017-06-20 13:35:31 -0400 | [diff] [blame] | 11 | |
| 12 | consul: |
| 13 | image: consul:latest |
| 14 | |
| 15 | # Deploy to all docker manager nodes |
| 16 | deploy: |
khenaidoo | 0ccef98 | 2017-08-02 13:41:13 -0400 | [diff] [blame] | 17 | replicas: 3 |
Richard Jankowski | a186796 | 2017-06-20 13:35:31 -0400 | [diff] [blame] | 18 | 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 Jankowski | 63ce1b4 | 2017-08-08 11:31:51 -0400 | [diff] [blame] | 36 | - -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 Jankowski | a186796 | 2017-06-20 13:35:31 -0400 | [diff] [blame] | 42 | networks: |
| 43 | - net |
| 44 | - voltha-net |
| 45 | ports: |
| 46 | - "8300:8300" |
| 47 | - "8400:8400" |
| 48 | - "8500:8500" |
| 49 | - "8600:8600/udp" |
| 50 | |
| 51 | networks: |
| 52 | net: |
| 53 | driver: overlay |
schowdhury | d908496 | 2017-06-21 14:51:49 -0700 | [diff] [blame] | 54 | driver_opts: |
| 55 | encrypted: "true" |
Richard Jankowski | a186796 | 2017-06-20 13:35:31 -0400 | [diff] [blame] | 56 | ipam: |
| 57 | driver: default |
| 58 | config: |
Richard Jankowski | 63ce1b4 | 2017-08-08 11:31:51 -0400 | [diff] [blame] | 59 | - subnet: 172.29.20.0/29 |
Richard Jankowski | a186796 | 2017-06-20 13:35:31 -0400 | [diff] [blame] | 60 | voltha-net: |
| 61 | external: |
| 62 | name: voltha_net |
| 63 | |