-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathetcd-stack.yml
117 lines (110 loc) · 2.85 KB
/
etcd-stack.yml
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
version: '3.8'
services:
etcd-00:
image: quay.io/coreos/etcd:v3.5.0
hostname: etcd-00
command:
- etcd
- --name=etcd-00
- --data-dir=data.etcd
- --advertise-client-urls=http://etcd-00:2379
- --listen-client-urls=http://0.0.0.0:2379
- --initial-advertise-peer-urls=http://etcd-00:2380
- --listen-peer-urls=http://0.0.0.0:2380
- --initial-cluster=etcd-00=http://etcd-00:2380,etcd-01=http://etcd-01:2380,etcd-02=http://etcd-02:2380
- --initial-cluster-state=new
- --initial-cluster-token=etcd-cluster-1
volumes:
- etcd-00vol:/data.etcd
networks:
- etcd
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
etcd-01:
image: quay.io/coreos/etcd:v3.5.0
hostname: etcd-01
command:
- etcd
- --name=etcd-01
- --data-dir=data.etcd
- --advertise-client-urls=http://etcd-01:2379
- --listen-client-urls=http://0.0.0.0:2379
- --initial-advertise-peer-urls=http://etcd-01:2380
- --listen-peer-urls=http://0.0.0.0:2380
- --initial-cluster=etcd-00=http://etcd-00:2380,etcd-01=http://etcd-01:2380,etcd-02=http://etcd-02:2380
- --initial-cluster-state=new
- --initial-cluster-token=etcd-cluster-1
volumes:
- etcd-01vol:/data.etcd
networks:
- etcd
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
etcd-02:
image: quay.io/coreos/etcd:v3.5.0
hostname: etcd-02
command:
- etcd
- --name=etcd-02
- --data-dir=data.etcd
- --advertise-client-urls=http://etcd-02:2379
- --listen-client-urls=http://0.0.0.0:2379
- --initial-advertise-peer-urls=http://etcd-02:2380
- --listen-peer-urls=http://0.0.0.0:2380
- --initial-cluster=etcd-00=http://etcd-00:2380,etcd-01=http://etcd-01:2380,etcd-02=http://etcd-02:2380
- --initial-cluster-state=new
- --initial-cluster-token=etcd-cluster-1
volumes:
- etcd-02vol:/data.etcd
networks:
- etcd
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
nginx:
image: nginx:alpine
hostname: nginx-etcd
configs:
- source: nginx_config
target: /etc/nginx/nginx.conf
networks:
- etcd
ports:
- 2379:2379
deploy:
replicas: 1
update_config:
parallelism: 1
delay: 10s
restart_policy:
condition: on-failure
configs:
nginx_config:
file: ./nginx/nginx.conf
volumes:
etcd-00vol:
driver: local
etcd-01vol:
driver: local
etcd-02vol:
driver: local
networks:
etcd:
driver: overlay
driver_opts:
encrypted: "true"
internal: true