-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdocker-compose-raft.yaml
245 lines (240 loc) · 7.01 KB
/
docker-compose-raft.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
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
services:
install_plugins:
# This intermediate service is used to install the plugins
# before starting the GatewayD service.
image: alpine:3.20
command: ["/bin/sh", "/setup.sh"]
volumes:
- ./setup.sh:/setup.sh:ro
# Use the variable defined above to mount the GatewayD files.
- ./gatewayd-files:/gatewayd-files:rw
environment:
- GATEWAYD_FILES=/gatewayd-files
# If you want to install a specific version of GatewayD, you can set the
# GATEWAYD_VERSION environment variable to the desired version. Otherwise,
# the latest version will be installed.
# - GATEWAYD_VERSION=v0.9.5
# The architecture of the GatewayD and plugins to install.
# Default: amd64
# Possible values: amd64 or arm64
# - ARCH=amd64
- REDIS_URL=redis://redis:6379/0
write-postgres:
image: postgres:latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
read-postgres:
image: postgres:latest
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:latest
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
gatewayd-1:
image: gatewaydio/gatewayd:latest
pull_policy: always
command:
[
"run",
"--config",
"/gatewayd-files/gatewayd.yaml",
"--plugin-config",
"/gatewayd-files/gatewayd_plugins.yaml",
"--tracing",
"--collector-url",
"tempo:4317",
]
environment:
- GATEWAYD_CLIENTS_DEFAULT_WRITES_ADDRESS=write-postgres:5432
- GATEWAYD_CLIENTS_DEFAULT_READS_ADDRESS=read-postgres:5432
- GATEWAYD_RAFT_NODEID=node1
- GATEWAYD_RAFT_ISBOOTSTRAP=true
- GATEWAYD_RAFT_ADDRESS=gatewayd-1:2223
- GATEWAYD_RAFT_GRPCADDRESS=gatewayd-1:50051
- GATEWAYD_RAFT_PEERS=[{"id":"node2","address":"gatewayd-2:2223","grpcAddress":"gatewayd-2:50051"},{"id":"node3","address":"gatewayd-3:2223","grpcAddress":"gatewayd-3:50051"}]
ports:
- "15432:15432"
- "18080:18080"
- "19090:19090"
- "42223:2223"
- "50051:50051"
- "29090:9090"
volumes:
- ./gatewayd-files:/gatewayd-files:ro
- ./raft-data-1:/var/lib/gatewayd/raft
links:
- write-postgres
- read-postgres
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://gatewayd-1:18080/healthz"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
write-postgres:
condition: service_healthy
read-postgres:
condition: service_healthy
redis:
condition: service_healthy
install_plugins:
condition: service_completed_successfully
gatewayd-2:
image: gatewaydio/gatewayd:latest
pull_policy: always
command:
[
"run",
"--config",
"/gatewayd-files/gatewayd.yaml",
"--plugin-config",
"/gatewayd-files/gatewayd_plugins.yaml",
"--tracing",
"--collector-url",
"tempo:4317",
]
environment:
- GATEWAYD_CLIENTS_DEFAULT_WRITES_ADDRESS=write-postgres:5432
- GATEWAYD_CLIENTS_DEFAULT_READS_ADDRESS=read-postgres:5432
- GATEWAYD_RAFT_NODEID=node2
- GATEWAYD_RAFT_ISBOOTSTRAP=true
- GATEWAYD_RAFT_ADDRESS=gatewayd-2:2223
- GATEWAYD_RAFT_GRPCADDRESS=gatewayd-2:50051
- GATEWAYD_RAFT_PEERS=[{"id":"node1","address":"gatewayd-1:2223","grpcAddress":"gatewayd-1:50051"},{"id":"node3","address":"gatewayd-3:2223","grpcAddress":"gatewayd-3:50051"}]
ports:
- "15433:15432"
- "18081:18080"
- "19091:19090"
- "42224:2223"
- "50052:50051"
- "29091:9090"
volumes:
- ./gatewayd-files:/gatewayd-files:ro
- ./raft-data-2:/var/lib/gatewayd/raft
links:
- write-postgres
- read-postgres
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://gatewayd-2:18080/healthz"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
write-postgres:
condition: service_healthy
read-postgres:
condition: service_healthy
redis:
condition: service_healthy
install_plugins:
condition: service_completed_successfully
gatewayd-3:
image: gatewaydio/gatewayd:latest
pull_policy: always
command:
[
"run",
"--config",
"/gatewayd-files/gatewayd.yaml",
"--plugin-config",
"/gatewayd-files/gatewayd_plugins.yaml",
"--tracing",
"--collector-url",
"tempo:4317",
]
environment:
- GATEWAYD_CLIENTS_DEFAULT_WRITES_ADDRESS=write-postgres:5432
- GATEWAYD_CLIENTS_DEFAULT_READS_ADDRESS=read-postgres:5432
- GATEWAYD_RAFT_NODEID=node3
- GATEWAYD_RAFT_ISBOOTSTRAP=false
- GATEWAYD_RAFT_ADDRESS=gatewayd-3:2223
- GATEWAYD_RAFT_GRPCADDRESS=gatewayd-3:50051
- GATEWAYD_RAFT_PEERS=[{"id":"node1","address":"gatewayd-1:2223","grpcAddress":"gatewayd-1:50051"},{"id":"node2","address":"gatewayd-2:2223","grpcAddress":"gatewayd-2:50051"}]
ports:
- "15434:15432"
- "18082:18080"
- "19092:19090"
- "42225:2223"
- "50053:50051"
- "29092:9090"
volumes:
- ./gatewayd-files:/gatewayd-files:ro
- ./raft-data-3:/var/lib/gatewayd/raft
links:
- write-postgres
- read-postgres
- redis
healthcheck:
test: ["CMD", "curl", "-f", "http://gatewayd-3:18080/healthz"]
interval: 5s
timeout: 5s
retries: 5
depends_on:
write-postgres:
condition: service_healthy
read-postgres:
condition: service_healthy
redis:
condition: service_healthy
install_plugins:
condition: service_completed_successfully
prometheus:
image: prom/prometheus:latest
volumes:
- ./observability-configs/prometheus.yaml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
depends_on:
- gatewayd-1
- gatewayd-2
- gatewayd-3
tempo_init:
image: &tempoImage grafana/tempo:latest
user: root
entrypoint:
- "chown"
- "10001:10001"
- "/var/tempo"
volumes:
- ./tempo-data:/var/tempo
tempo:
image: *tempoImage
command: ["-config.file=/etc/tempo.yaml"]
volumes:
- ./observability-configs/tempo.yaml:/etc/tempo.yaml
- ./tempo-data:/var/tempo
ports:
- "4317:4317" # otlp grpc
depends_on:
- tempo_init
grafana:
image: grafana/grafana:latest
volumes:
- ./observability-configs/grafana-datasources.yaml:/etc/grafana/provisioning/datasources/datasources.yaml
environment:
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_DISABLE_LOGIN_FORM=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
ports:
- "3000:3000"
depends_on:
- prometheus
- tempo