-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
315 lines (237 loc) · 9.25 KB
/
Makefile
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
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
.DEFAULT_GOAL = help
LB_MANIFEST=apm_cluster/docker-compose.lb.yml
LOCALS3_MANIFEST=apm_cluster/docker-compose.locals3.yml
GRAFANA_MANIFEST=apm_cluster/docker-compose.grafana.yml
ALERTMANAGER_MANIFEST=apm_cluster/docker-compose.alertmanager.yml
METRICS_MANIFEST=apm_cluster/docker-compose.metrics.yml
LOGS_MANIFEST=apm_cluster/docker-compose.logs.yml
TRACING_MANIFEST=apm_cluster/docker-compose.tracing.yml
METAMONITORING_MANIFEST=apm_cluster/docker-compose.metaagents.yml
# Dev svc manifests
TEMPORAL_MANIFEST=apm_cluster/development/docker-compose.temporal.yml
SVC_DEV_MANIFEST=apm_cluster/development/docker-compose.services-dev.yml
SVC_PROD_MANIFEST=apm_cluster/development/docker-compose.services-prod.yml
SVC_AGENTS_MANIFEST=apm_cluster/development/docker-compose.agents.yml
CLUSTER_CONFIG=apm_cluster/cluster.config
TEMPORAL_CONFIG=apm_cluster/development/temporal.config
include ${CLUSTER_CONFIG}
include ${TEMPORAL_CONFIG}
# Build test svc
export DOCKER_BUILDKIT=true
export COMPOSE_DOCKER_CLI_BUILD=true
export
---------------------------------------------> : ## *Docker network deployment**
create_network: ## Create a network for cluster
@docker network create --attachable \
${NETWORK_NAME}
drop_network: ## Drop a network for cluster
@docker network rm ${NETWORK_NAME}
recreate_network: drop_network create_network ## ReCreate a network for cluster
---------------------------------------------> : ## **Load balancer deployment**
create_lb: ## Create lb
@docker-compose --file ${LB_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_lb: ## Drop lb
@docker-compose --file ${LB_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_lb: drop_lb create_lb ## ReCreate lb
logs_lb: ## Show logs of lb
@docker-compose --file ${LB_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **MinIO svc for local development**
create_local_s3: ## Create MinIO cluster
@docker-compose --file ${LOCALS3_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_local_s3: ## Drop MinIO cluster
@docker-compose --file ${LOCALS3_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_local_s3: drop_local_s3 create_local_s3 ## ReCreate MinIO cluster
logs_local_s3: ## Show logs of MinIO cluster
@docker-compose --file ${LOCALS3_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **Grafana development**
create_grafana: ## Create grafana
@docker-compose --file ${GRAFANA_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_grafana: ## Drop grafana
@docker-compose --file ${GRAFANA_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_grafana: drop_grafana create_grafana ## ReCreate grafana
logs_grafana: ## Show logs of grafana
@docker-compose --file ${GRAFANA_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **Alertmanager development**
create_alertmanager: ## Create alertmanager
@docker-compose --file ${ALERTMANAGER_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_alertmanager: ## Drop alertmanager
@docker-compose --file ${ALERTMANAGER_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_alertmanager: drop_alertmanager create_alertmanager ## ReCreate alertmanager
logs_alertmanager: ## Show logs of alertmanager
@docker-compose --file ${ALERTMANAGER_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **Mimir cluster in read/write deployment mode**
create_metrics_cluster: ## Create Mimir cluster
@docker-compose --file ${METRICS_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_metrics_cluster: ## Drop Mimir cluster
@docker-compose --file ${METRICS_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_metrics_cluster: drop_metrics_cluster create_metrics_cluster ## ReCreate Mimir cluster
logs_metrics_cluster: ## Show logs of Mimir cluster
@docker-compose --file ${METRICS_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **Loki cluster in read/write deployment mode**
create_logging_cluster: ## Create Loki cluster
@docker-compose --file ${LOGS_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_logging_cluster: ## Drop Loki cluster
@docker-compose --file ${LOGS_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_logging_cluster: drop_logging_cluster create_logging_cluster ## ReCreate Loki cluster
logs_logging_cluster: ## Show logs of Loki cluster
@docker-compose --file ${LOGS_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **Tempo cluster in read/write deployment mode**
create_tracing_cluster: ## Create Tempo cluster
@docker-compose --file ${TRACING_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_tracing_cluster: ## Drop Tempo cluster
@docker-compose --file ${TRACING_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_tracing_cluster: drop_tracing_cluster create_tracing_cluster ## ReCreate Tempo cluster
logs_tracing_cluster: ## Show logs of Tempo cluster
@docker-compose --file ${TRACING_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **Metamonitoring agents deployment**
create_metamon_cluster: ## Create Meta agents
@docker-compose --file ${METAMONITORING_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
up \
--detach \
--force-recreate
drop_metamon_cluster: ## Drop Meta agents
@docker-compose --file ${METAMONITORING_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
down
recreate_metamon_cluster: drop_metamon_cluster create_metamon_cluster ## ReCreate Meta agents
logs_metamon_cluster: ## Show logs of Meta agents
@docker-compose --file ${METAMONITORING_MANIFEST} \
--env-file ${CLUSTER_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **Temporal deployment**
create_temporal_cluster: ## Create Temporal
@docker-compose --file ${TEMPORAL_MANIFEST} \
--env-file ${TEMPORAL_CONFIG} \
up \
--detach \
--force-recreate
drop_temporal_cluster: ## Drop Temporal
@docker-compose --file ${TEMPORAL_MANIFEST} \
--env-file ${TEMPORAL_CONFIG} \
down
recreate_temporal_cluster: drop_temporal_cluster create_temporal_cluster ## ReCreate Temporal
logs_temporal_cluster: ## Show logs of Temporal
@docker-compose --file ${TEMPORAL_MANIFEST} \
--env-file ${TEMPORAL_CONFIG} \
logs \
--follow
---------------------------------------------> : ## **SVC_DEV deployment**
create_svc_dev: ## Create svc_dev
@docker-compose --file ${SVC_DEV_MANIFEST} \
up \
--detach \
--force-recreate\
--build
drop_svc_dev: ## Drop svc_dev
@docker-compose --file ${SVC_DEV_MANIFEST} \
down
recreate_svc_dev: drop_svc_dev create_svc_dev ## ReCreate svc_dev
logs_svc_dev: ## Show logs of svc_dev
@docker-compose --file ${SVC_DEV_MANIFEST} \
logs \
--follow
---------------------------------------------> : ## **SVC_PROD deployment**
create_svc_prod: ## Create svc_prod
@docker-compose --file ${SVC_PROD_MANIFEST} \
up \
--detach \
--force-recreate
drop_svc_prod: ## Drop svc_prod
@docker-compose --file ${SVC_PROD_MANIFEST} \
down
recreate_svc_prod: drop_svc_prod create_svc_prod ## ReCreate svc_prod
logs_svc_prod: ## Show logs of svc_prod
@docker-compose --file ${SVC_PROD_MANIFEST} \
logs \
--follow \
--build
---------------------------------------------> : ## **SVC_AGENTS deployment**
create_svc_agents: ## Create svc_agents
@docker-compose --file ${SVC_AGENTS_MANIFEST} \
up \
--detach \
--force-recreate
drop_svc_agents: ## Drop svc_agents
@docker-compose --file ${SVC_AGENTS_MANIFEST} \
down
recreate_svc_agents: drop_svc_agents create_svc_agents ## ReCreate svc_agents
logs_svc_agents: ## Show logs of svc_agents
@docker-compose --file ${SVC_AGENTS_MANIFEST} \
logs \
--follow
---------------------------------------------> : ## **Cluster deployment**
create_all: create_network create_local_s3 create_grafana create_alertmanager create_metrics_cluster create_logging_cluster create_tracing_cluster create_metamon_cluster create_lb ## Deploy all part of cluster
drop_all: drop_metamon_cluster drop_grafana drop_alertmanager drop_metrics_cluster drop_logging_cluster drop_tracing_cluster drop_local_s3 drop_lb drop_network ## Drop all part of cluster
---------------------------------------------> : ## **System commands**
prune_system: ## Prune docker system
@docker system prune --force
help: ## Show help
@awk 'BEGIN {FS = ":.*?## "} \
/^[a-z A-Z0-9\[\]\<\>_-]+:.*?## / \
{printf " \033[36m%-47s\033[0m %s\n", $$1, $$2}' \
$(MAKEFILE_LIST)