forked from TencentBlueKing/bk-bcs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
480 lines (378 loc) · 29.4 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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
# BlueKing Container System Makefile
# default config
MAKE:=make
bcs_edition?=inner_edition
# init the build information
ifdef HASTAG
GITTAG=${HASTAG}
else
GITTAG=$(shell git describe --always)
endif
BUILDTIME = $(shell date +%Y-%m-%dT%T%z)
GITHASH=$(shell git rev-parse HEAD)
VERSION=${GITTAG}-$(shell date +%y.%m.%d)
WORKSPACE=$(shell pwd)
BCS_SERVICES_PATH=${WORKSPACE}/bcs-services
BCS_NETWORK_PATH=${WORKSPACE}/bcs-runtime/bcs-k8s/bcs-network
BCS_COMPONENT_PATH=${WORKSPACE}/bcs-runtime/bcs-k8s/bcs-component
BCS_MESOS_PATH=${WORKSPACE}/bcs-runtime/bcs-mesos
BCS_CONF_COMPONENT_PATH=${WORKSPACE}/install/conf/bcs-runtime/bcs-k8s/bcs-component
BCS_CONF_NETWORK_PATH=${WORKSPACE}/install/conf/bcs-runtime/bcs-k8s/bcs-network
BCS_CONF_MESOS_PATH=${WORKSPACE}/install/conf/bcs-runtime/bcs-mesos
BCS_CONF_SERVICES_PATH=${WORKSPACE}/install/conf/bcs-services
LDFLAG=-ldflags "-X github.com/Tencent/bk-bcs/bcs-common/common/static.ZookeeperClientUser=${bcs_zk_client_user} \
-X github.com/Tencent/bk-bcs/bcs-common/common/static.ZookeeperClientPwd=${bcs_zk_client_pwd} \
-X github.com/Tencent/bk-bcs/bcs-common/common/static.EncryptionKey=${bcs_encryption_key} \
-X github.com/Tencent/bk-bcs/bcs-common/common/static.ServerCertPwd=${bcs_server_cert_pwd} \
-X github.com/Tencent/bk-bcs/bcs-common/common/static.ClientCertPwd=${bcs_client_cert_pwd} \
-X github.com/Tencent/bk-bcs/bcs-common/common/static.LicenseServerClientCertPwd=${bcs_license_server_client_cert_pwd} \
-X github.com/Tencent/bk-bcs/bcs-common/common/static.BcsDefaultUser=${bcs_registry_default_user} \
-X github.com/Tencent/bk-bcs/bcs-common/common/static.BcsDefaultPasswd=${bcs_registry_default_pwd} \
-X github.com/Tencent/bk-bcs/bcs-common/common/version.BcsVersion=${VERSION} \
-X github.com/Tencent/bk-bcs/bcs-common/common/version.BcsBuildTime=${BUILDTIME} \
-X github.com/Tencent/bk-bcs/bcs-common/common/version.BcsGitHash=${GITHASH} \
-X github.com/Tencent/bk-bcs/bcs-common/common/version.BcsTag=${GITTAG} \
-X github.com/Tencent/bk-bcs/bcs-common/common/version.BcsEdition=${bcs_edition}"
# build path config
PACKAGEPATH=./build/bcs.${VERSION}
EXPORTPATH=./build/api_export
# options
default:bcs-runtime bcs-scenarios bcs-services #TODO: bcs-resources
bcs-runtime: bcs-k8s bcs-mesos
bcs-k8s: bcs-component bcs-network
bcs-component:k8s-driver \
cc-agent csi-cbs kube-sche federated-apiserver apiserver-proxy \
apiserver-proxy-tools logbeat-sidecar webhook-server clusternet-controller mcs-agent \
general-pod-autoscaler cluster-autoscaler
bcs-network:network networkpolicy cloud-netservice cloud-netcontroller cloud-netagent
bcs-mesos:executor mesos-driver mesos-watch scheduler loadbalance netservice hpacontroller \
consoleproxy process-executor process-daemon bmsf-mesos-adapter detection clb-controller gw-controller
bcs-services:api client bkcmdb-synchronizer cpuset gateway log-manager \
mesh-manager netservice sd-prometheus storage \
user-manager cluster-manager tools alert-manager k8s-watch kube-agent data-manager \
helm-manager project-manager nodegroup-manager
bcs-scenarios: kourse
kourse: gamedeployment gamestatefulset hook-operator
allpack: svcpack k8spack mmpack mnpack netpack
cd build && tar -czf bcs.${VERSION}.tgz bcs.${VERSION}
# tag for different edition compiling
inner:
$(MAKE) default bcs_edition=inner_edition
ce:
$(MAKE) default bcs_edition=community_edition
ee:
$(MAKE) default bcs_edition=enterprise_edition
clean:
rm -rf ./build
svcpack:
cd ./build/bcs.${VERSION}/bcs-services && find . -type f ! -name MD5 | xargs -L1 md5sum > MD5
k8spack:
cd ./build/bcs.${VERSION}/bcs-runtime/bcs-k8s/bcs-component && find . -type f ! -name MD5 | xargs -L1 md5sum > MD5
mmpack:
cd ./build/bcs.${VERSION}/bcs-runtime/bcs-mesos/bcs-mesos-master && find . -type f ! -name MD5 | xargs -L1 md5sum > MD5
mnpack:
cd ./build/bcs.${VERSION}/bcs-runtime/bcs-mesos/bcs-mesos-node && find . -type f ! -name MD5 | xargs -L1 md5sum > MD5
netpack:
cd ./build/bcs.${VERSION}/bcs-runtime/bcs-k8s/bcs-network && find . -type f ! -name MD5 | xargs -L1 md5sum > MD5
pre:
@echo "git tag: ${GITTAG}"
mkdir -p ${PACKAGEPATH}
mkdir -p ${EXPORTPATH}
go mod tidy
go fmt ./...
cd ./scripts && chmod +x vet.sh && ./vet.sh
api:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-api ${PACKAGEPATH}/bcs-services
cd bcs-services/bcs-api && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-api/bcs-api ./main.go
gateway:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-gateway-discovery ${PACKAGEPATH}/bcs-services
cp -R ./bcs-services/bcs-gateway-discovery/plugins/apisix ${PACKAGEPATH}/bcs-services/bcs-gateway-discovery/
cd bcs-services/bcs-gateway-discovery && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-gateway-discovery/bcs-gateway-discovery ./main.go
micro-gateway:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-micro-gateway
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-gateway-discovery/* ${PACKAGEPATH}/bcs-services/bcs-micro-gateway/
cp -R ./bcs-services/bcs-gateway-discovery/plugins/apisix ${PACKAGEPATH}/bcs-services/bcs-micro-gateway/
client:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-client ${PACKAGEPATH}/bcs-services
cd ./bcs-services/bcs-client && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-client/bcs-client ./cmd/main.go
dns:
mkdir -p ${PACKAGEPATH}/bcs-services
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-dns ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-dns-service ${PACKAGEPATH}/bcs-services
cd ../coredns && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-dns-service/bcs-dns-service coredns.go
cd ../coredns && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-dns/bcs-dns coredns.go
storage:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-storage ${PACKAGEPATH}/bcs-services
cd ./bcs-services/bcs-storage && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-storage/bcs-storage ./storage.go
loadbalance:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-loadbalance/bcs-loadbalance ${BCS_MESOS_PATH}/bcs-loadbalance/main.go
cp -r ${BCS_MESOS_PATH}/bcs-loadbalance/image/* ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-loadbalance/
executor:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-container-executor/bcs-container-executor ${BCS_MESOS_PATH}/bcs-container-executor/main.go
process-executor:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-process-executor/bcs-process-executor ${BCS_MESOS_PATH}/bcs-process-executor/main.go
process-daemon:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-node/bcs-process-daemon ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-process-daemon/bcs-process-daemon ${BCS_MESOS_PATH}/bcs-process-daemon/main.go
netservice:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-netservice ${PACKAGEPATH}/bcs-services
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-services/bcs-netservice/bcs-netservice ./bcs-services/bcs-netservice/main.go
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-netservice ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-netservice/bcs-netservice ./bcs-services/bcs-netservice/main.go
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-cni/bin/conf
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-cni/conf
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-node/bcs-ipam/bcs.conf.template ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-cni/bin/conf
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-cni/bin/bcs-ipam ./bcs-services/bcs-netservice/bcs-ipam/main.go
mesos-driver:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-mesos-driver ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-mesos-driver/bcs-mesos-driver ${BCS_MESOS_PATH}/bcs-mesos-driver/main.go
mesos-watch:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-mesos-watch ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-mesos-watch/bcs-mesos-watch ${BCS_MESOS_PATH}/bcs-mesos-watch/main.go
kube-sche:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-k8s-custom-scheduler ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-k8s-custom-scheduler && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-custom-scheduler/bcs-k8s-custom-scheduler ./main.go
csi-cbs:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-k8s-csi-tencentcloud ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-k8s-csi-tencentcloud/bcs-k8s-csi-tencentcloud ${BCS_COMPONENT_PATH}/bcs-k8s-csi-tencentcloud/cmd/cbs/main.go
scheduler:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-scheduler ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cd ${BCS_MESOS_PATH}/bcs-scheduler && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-scheduler/bcs-scheduler ./main.go && cd -
cd ${BCS_MESOS_PATH}/bcs-scheduler && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go build -buildmode=plugin -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-scheduler/plugin/bin/ip-resources/ip-resources.so ./src/plugin/bin/ip-resources/ipResource.go && cd -
cd ${BCS_MESOS_PATH}/bcs-scheduler && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-scheduler/bcs-migrate-data ./bcs-migrate-data/main.go && cd -
logbeat-sidecar:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-logbeat-sidecar ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ./bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-logbeat-sidecar/bcs-logbeat-sidecar ./main.go
multi-ns-proxy:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-multi-ns-proxy ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ./bcs-runtime/bcs-k8s/bcs-component/bcs-multi-ns-proxy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-multi-ns-proxy/bcs-multi-ns-proxy ./main.go
log-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-log-manager ${PACKAGEPATH}/bcs-services
cd ./bcs-services/bcs-log-manager && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-log-manager/bcs-log-manager ./main.go
mesh-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-mesh-manager ${PACKAGEPATH}/bcs-services
cd bcs-services/bcs-mesh-manager && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-mesh-manager/bcs-mesh-manager ./main.go
hpacontroller:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-hpacontroller ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-hpacontroller/bcs-hpacontroller ${BCS_MESOS_PATH}/bcs-hpacontroller
sd-prometheus:pre
mkdir -p ${PACKAGEPATH}/bcs-services
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-service-prometheus-service ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-service-prometheus ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-services/bcs-service-prometheus-service/bcs-service-prometheus-service ./bcs-services/bcs-service-prometheus/main.go
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-service-prometheus/bcs-service-prometheus ./bcs-services/bcs-service-prometheus/main.go
k8s-driver:pre
cd ${BCS_COMPONENT_PATH}/bcs-k8s-driver && go mod tidy -go=1.16 && go mod tidy -go=1.17 && make k8s-driver
federated-apiserver:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-federated-apiserver ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-federated-apiserver && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-federated-apiserver/bcs-federated-apiserver ./cmd/apiserver/main.go
federated-apiserver-kubectl-agg:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-federated-apiserver && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-federated-apiserver/kubectl-agg ./cmd/kubectl-agg/main.go
egress-controller:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-egress-controller ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
#copy nginx template for egress controller
cp -R ${BCS_COMPONENT_PATH}/bcs-egress/deploy/config ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-egress-controller
cd ${BCS_COMPONENT_PATH}/bcs-egress && go mod tidy && go build -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-egress-controller/bcs-egress-controller ./cmd/bcs-egress-controller/main.go
webhook-server:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-webhook-server ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-webhook-server && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-webhook-server/bcs-webhook-server ./cmd/server.go
consoleproxy:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-node/bcs-consoleproxy ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-node/bcs-consoleproxy/bcs-consoleproxy ${BCS_MESOS_PATH}/bcs-consoleproxy/main.go
bmsf-mesos-adapter:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bmsf-mesos-adapter ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cd ${BCS_MESOS_PATH}/bmsf-mesh && go mod tidy && go build ${LDFLAG} -o ../${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bmsf-mesos-adapter/bmsf-mesos-adapter ./bmsf-mesos-adapter/main.go
cpuset:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-cpuset-device ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-cpuset-device/bcs-cpuset-device ${BCS_COMPONENT_PATH}/bcs-cpuset-device/main.go
detection:pre
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-network-detection ${PACKAGEPATH}/bcs-services
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-services/bcs-network-detection/bcs-network-detection ./bcs-services/bcs-network-detection/main.go
tools:
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-services/cryptools ./install/cryptool/main.go
user-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-user-manager
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-user-manager ${PACKAGEPATH}/bcs-services
cd bcs-services/bcs-user-manager/ && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-user-manager/bcs-user-manager ./main.go
webconsole:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-webconsole
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-webconsole ${PACKAGEPATH}/bcs-services
cd bcs-services/bcs-webconsole/ && go mod tidy && CGO_ENABLED=0 go build -trimpath ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-webconsole/bcs-webconsole ./main.go
monitor:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-monitor
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-monitor ${PACKAGEPATH}/bcs-services
cd bcs-services/bcs-monitor/ && go mod tidy && CGO_ENABLED=0 go build -trimpath ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-monitor/bcs-monitor ./cmd/bcs-monitor
k8s-watch:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-k8s-watch ${PACKAGEPATH}/bcs-services
cd ./bcs-services/bcs-k8s-watch && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-k8s-watch/bcs-k8s-watch ./main.go
kube-agent:pre
mkdir -p ${PACKAGEPATH}/bcs-services
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-kube-agent ${PACKAGEPATH}/bcs-services
cd ./bcs-services/bcs-kube-agent && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-kube-agent/bcs-kube-agent ./main.go
cc-agent:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-cc-agent ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-cc-agent/bcs-cc-agent ${BCS_COMPONENT_PATH}/bcs-cc-agent/main.go
clusternet-controller:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-clusternet-controller ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-clusternet-controller && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-clusternet-controller/bcs-clusternet-controller ./cmd/clusternet-controller/main.go
mcs-agent:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-mcs-agent ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-mcs && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-mcs-agent/bcs-mcs-agent ./cmd/mcs-agent/main.go
general-pod-autoscaler:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-general-pod-autoscaler ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-general-pod-autoscaler && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-general-pod-autoscaler/bcs-general-pod-autoscaler ./cmd/gpa/main.go
cluster-autoscaler:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-cluster-autoscaler ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component
cd ${BCS_COMPONENT_PATH}/bcs-cluster-autoscaler && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-cluster-autoscaler/bcs-cluster-autoscaler ./main.go
# network plugins section
networkpolicy:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make networkpolicy
cloud-network-agent:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make bcs-cloud-network-agent
bkcmdb-synchronizer:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-bkcmdb-synchronizer
go mod tidy && go build ${LDFLAG} -o ${PACKAGEPATH}/bcs-services/bcs-bkcmdb-synchronizer/bcs-bkcmdb-synchronizer ./bcs-services/bcs-bkcmdb-synchronizer/main.go
cloud-netservice:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make cloud-netservice
cloud-netcontroller:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make cloud-netcontroller
cloud-netagent:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make cloud-netagent
ingress-controller:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make ingress-controller
ipmasq-cidrsync:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make ipmasq-cidrsync
ipres-webhook:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make ipres-webhook
network:pre
cd ${BCS_NETWORK_PATH} && go mod tidy && make network
clb-controller:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-clb-controller ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp ${BCS_MESOS_PATH}/bcs-clb-controller/docker/Dockerfile ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-clb-controller/Dockerfile.old
cd ${BCS_MESOS_PATH}/bcs-clb-controller && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-clb-controller/bcs-clb-controller ./main.go && cd -
cp ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-clb-controller/bcs-clb-controller ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-clb-controller/clb-controller
gw-controller:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cp -R ${BCS_CONF_MESOS_PATH}/bcs-mesos-master/bcs-gw-controller ${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master
cd ${BCS_MESOS_PATH}/bcs-clb-controller && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-mesos/bcs-mesos-master/bcs-gw-controller/bcs-gw-controller ./bcs-gw-controller/main.go
#end of network plugins
# bcs-service section
cluster-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-cluster-manager
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-cluster-manager/* ${PACKAGEPATH}/bcs-services/bcs-cluster-manager/
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-cluster-manager/swagger
cp -R ${BCS_SERVICES_PATH}/bcs-cluster-manager/third_party/swagger-ui ${PACKAGEPATH}/bcs-services/bcs-cluster-manager/swagger/
cp ${BCS_SERVICES_PATH}/bcs-cluster-manager/api/clustermanager/clustermanager.swagger.json ${PACKAGEPATH}/bcs-services/bcs-cluster-manager/swagger/swagger-ui/clustermanager.swagger.json
cd ${BCS_SERVICES_PATH}/bcs-cluster-manager && go mod tidy -compat=1.17 && go build ${GITHUB_LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-cluster-manager/bcs-cluster-manager ./main.go
alert-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-alert-manager/* ${PACKAGEPATH}/bcs-services/bcs-alert-manager
cp -R ./bcs-services/bcs-alert-manager/pkg/third_party/swagger-ui ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger/swagger-ui
cp ./bcs-services/bcs-alert-manager/pkg/proto/alertmanager/alertmanager.swagger.json ${PACKAGEPATH}/bcs-services/bcs-alert-manager/swagger/alertmanager.swagger.json
cd ./bcs-services/bcs-alert-manager/ && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-alert-manager/bcs-alert-manager ./main.go
project-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-project-manager/swagger
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-project-manager/* ${PACKAGEPATH}/bcs-services/bcs-project-manager
cp -R ${BCS_SERVICES_PATH}/bcs-project-manager/third_party/swagger-ui ${PACKAGEPATH}/bcs-services/bcs-project-manager/swagger/swagger-ui
cp ${BCS_SERVICES_PATH}/bcs-project-manager/proto/bcsproject/bcsproject.swagger.json ${PACKAGEPATH}/bcs-services/bcs-project-manager/swagger/bcsproject.swagger.json
cd ${BCS_SERVICES_PATH}/bcs-project-manager && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-project-manager/bcs-project-manager ./main.go
CR_LDFLAG_EXT=" -X github.com/Tencent/bk-bcs/bcs-services/cluster-resources/pkg/version.Version=${VERSION} \
-X github.com/Tencent/bk-bcs/bcs-services/cluster-resources/pkg/version.GitCommit=${GITHASH} \
-X github.com/Tencent/bk-bcs/bcs-services/cluster-resources/pkg/version.BuildTime=${BUILDTIME}"
cluster-resources:pre
mkdir -p ${PACKAGEPATH}/bcs-services/cluster-resources
cp -R ${BCS_CONF_SERVICES_PATH}/cluster-resources/* ${PACKAGEPATH}/bcs-services/cluster-resources
# etc config files
mkdir -p ${PACKAGEPATH}/bcs-services/cluster-resources/etc
cp -R ${BCS_SERVICES_PATH}/cluster-resources/etc/ ${PACKAGEPATH}/bcs-services/cluster-resources/etc/
# swagger files
mkdir -p ${PACKAGEPATH}/bcs-services/cluster-resources/swagger
cp -R ${BCS_SERVICES_PATH}/cluster-resources/third_party/swagger-ui/ ${PACKAGEPATH}/bcs-services/cluster-resources/swagger/swagger-ui/
cp ${BCS_SERVICES_PATH}/cluster-resources/swagger/data/cluster-resources.swagger.json ${PACKAGEPATH}/bcs-services/cluster-resources/swagger/cluster-resources.swagger.json
# example files
mkdir -p ${PACKAGEPATH}/bcs-services/cluster-resources/example/
cp -R ${BCS_SERVICES_PATH}/cluster-resources/pkg/resource/example/config/ ${PACKAGEPATH}/bcs-services/cluster-resources/example/config/
cp -R ${BCS_SERVICES_PATH}/cluster-resources/pkg/resource/example/manifest/ ${PACKAGEPATH}/bcs-services/cluster-resources/example/manifest/
cp -R ${BCS_SERVICES_PATH}/cluster-resources/pkg/resource/example/reference/ ${PACKAGEPATH}/bcs-services/cluster-resources/example/reference/
# form tmpl & schema files
cp -R ${BCS_SERVICES_PATH}/cluster-resources/pkg/resource/form/tmpl/ ${PACKAGEPATH}/bcs-services/cluster-resources/tmpl/
# i18n files
cp ${BCS_SERVICES_PATH}/cluster-resources/pkg/i18n/locale/lc_msgs.yaml ${PACKAGEPATH}/bcs-services/cluster-resources/lc_msgs.yaml
# go build
cd ${BCS_SERVICES_PATH}/cluster-resources && go mod tidy -compat=1.17 && CGO_ENABLED=0 go build ${LDFLAG}${CR_LDFLAG_EXT} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/cluster-resources/bcs-cluster-resources *.go
# end of bcs-service section
apiserver-proxy:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy
cp -R ${BCS_CONF_COMPONENT_PATH}/bcs-apiserver-proxy/* ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy
cd ${BCS_COMPONENT_PATH}/bcs-apiserver-proxy && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/bcs-apiserver-proxy ./main.go
cd ${BCS_COMPONENT_PATH}/bcs-apiserver-proxy/ipvs_tools && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/apiserver-proxy-tools .
apiserver-proxy-tools:pre
mkdir -p ${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy
cd ${BCS_COMPONENT_PATH}/bcs-apiserver-proxy/ipvs_tools && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-runtime/bcs-k8s/bcs-component/bcs-apiserver-proxy/apiserver-proxy-tools .
data-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-data-manager
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-data-manager ${PACKAGEPATH}/bcs-services
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-data-manager/swagger
cp -R ${BCS_SERVICES_PATH}/bcs-data-manager/third_party/swagger-ui/* ${PACKAGEPATH}/bcs-services/bcs-data-manager/swagger/
cp ${BCS_SERVICES_PATH}/bcs-data-manager/proto/bcs-data-manager/bcs-data-manager.swagger.json ${PACKAGEPATH}/bcs-services/bcs-data-manager/swagger/bcs-data-manager.swagger.json
cd bcs-services/bcs-data-manager/ && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-data-manager/bcs-data-manager ./main.go
helm-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-helm-manager
cp -R ${BCS_SERVICES_PATH}/bcs-helm-manager/images/bcs-helm-manager/* ${PACKAGEPATH}/bcs-services/bcs-helm-manager/
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-helm-manager/swagger
cp -R ${BCS_SERVICES_PATH}/bcs-helm-manager/third_party/swagger-ui ${PACKAGEPATH}/bcs-services/bcs-helm-manager/swagger/
cp ${BCS_SERVICES_PATH}/bcs-helm-manager/proto/bcs-helm-manager/bcs-helm-manager.swagger.json ${PACKAGEPATH}/bcs-services/bcs-helm-manager/swagger/swagger-ui/bcs-helm-manager.swagger.json
cd ${BCS_SERVICES_PATH}/bcs-helm-manager && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-helm-manager/bcs-helm-manager ./main.go
cd ${BCS_SERVICES_PATH}/bcs-helm-manager && go mod tidy && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-helm-manager/bcs-helm-manager-migrator ./cmd/bcs-helm-manager-migrator/main.go
nodegroup-manager:pre
mkdir -p ${PACKAGEPATH}/bcs-services/bcs-nodegroup-manager
cp -R ${BCS_CONF_SERVICES_PATH}/bcs-nodegroup-manager ${PACKAGEPATH}/bcs-services
cd bcs-services/bcs-nodegroup-manager/ && go mod tidy -go=1.16 && go mod tidy -go=1.17 && go build ${LDFLAG} -o ${WORKSPACE}/${PACKAGEPATH}/bcs-services/bcs-nodegroup-manager/bcs-nodegroup-manager ./main.go
test: test-bcs-runtime
test-bcs-runtime: test-bcs-k8s
test-bcs-k8s: test-bcs-service
test-bcs-service: test-user-manager
test-user-manager:
@./scripts/test.sh ${BCS_SERVICES_PATH}/bcs-user-manager
gamedeployment:
make gamedeployment -f bcs-scenarios/kourse/Makefile
gamestatefulset:
make gamestatefulset -f bcs-scenarios/kourse/Makefile
hook-operator:
make hook-operator -f bcs-scenarios/kourse/Makefile