-
Notifications
You must be signed in to change notification settings - Fork 0
/
hisujung-test.yaml
456 lines (454 loc) · 10.5 KB
/
hisujung-test.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
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
#######################################################
### app: msa-rabbitmq-pvc
# msa-rabbitmq PVC
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: msa-rabbitmq-pvc
labels:
app: msa-rabbitmq-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
storageClassName: standard
---
# msa-rabbitmq Service
apiVersion: v1
kind: Service
metadata:
name: msa-rabbitmq
labels:
app: msa-rabbitmq
spec:
type: LoadBalancer # 대시보드 접근용
ports:
- port: 5672
name: amqp
- port: 15672
name: management
selector:
app: msa-rabbitmq
---
### app: msa-rabbitmq
# msa-rabbitmq StatefulSet
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: msa-rabbitmq
spec:
replicas: 1
serviceName: msa-rabbitmq
selector:
matchLabels:
app: msa-rabbitmq
template:
metadata:
labels:
app: msa-rabbitmq
spec:
containers:
- name: msa-rabbitmq
image: rabbitmq:3-management
ports:
- containerPort: 5672
name: amqp
- containerPort: 15672
name: management
env:
- name: RABBITMQ_DEFAULT_USER
valueFrom:
secretKeyRef:
name: rabbitmq-secret
key: RABBITMQ_DEFAULT_USER
- name: RABBITMQ_DEFAULT_PASS
valueFrom:
secretKeyRef:
name: rabbitmq-secret
key: RABBITMQ_DEFAULT_PASS
volumeMounts:
- mountPath: /var/lib/rabbitmq
name: rabbitmq-data
livenessProbe:
httpGet:
path: /
port: 15672
scheme: HTTP
initialDelaySeconds: 60
periodSeconds: 10
timeoutSeconds: 10
volumes:
- name: rabbitmq-data
persistentVolumeClaim:
claimName: msa-rabbitmq-pvc
---
#######################################################
### msa-crawling-external
apiVersion: batch/v1
kind: CronJob
metadata:
name: msa-crawling-external
spec:
schedule: "0 8 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: msa-crawling-external
image: hyezis/msa-crawling-external:latest
env:
- name: RABBITMQ_HOST
value: msa-rabbitmq
- name: RABBITMQ_USER
valueFrom:
secretKeyRef:
name: rabbitmq-secret
key: RABBITMQ_DEFAULT_USER
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: rabbitmq-secret
key: RABBITMQ_DEFAULT_PASS
restartPolicy: OnFailure
imagePullSecrets:
- name: regcred
---
### msa-crawling-univ
apiVersion: batch/v1
kind: CronJob
metadata:
name: msa-crawling-univ
spec:
schedule: "0 8 * * *"
jobTemplate:
spec:
template:
spec:
containers:
- name: msa-crawling-univ
image: hyezis/msa-crawling-univ:latest
env:
- name: RABBITMQ_HOST
value: msa-rabbitmq
- name: RABBITMQ_USER
valueFrom:
secretKeyRef:
name: rabbitmq-secret
key: RABBITMQ_DEFAULT_USER
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: rabbitmq-secret
key: RABBITMQ_DEFAULT_PASS
restartPolicy: OnFailure
imagePullSecrets:
- name: regcred
---
#######################################################
### app: msa-member
# msa-member Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: member-deployment
spec:
replicas: 1
selector:
matchLabels:
app: msa-member
template:
metadata:
labels:
app: msa-member
spec:
containers:
- name: msa-member
image: suhyen/msa-member:v2
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "100m" # 0.1 CPU core
env:
- name: MYSQL_URL
valueFrom:
secretKeyRef:
name: member-secret
key: mysql-url
- name: MYSQL_USERNAME
valueFrom:
secretKeyRef:
name: member-secret
key: mysql-username
- name: MYSQL_PASSWORD
valueFrom:
secretKeyRef:
name: member-secret
key: mysql-password
- name: EMAIL_USERNAME
valueFrom:
secretKeyRef:
name: member-secret
key: email-username
- name: EMAIL_PASSWORD
valueFrom:
secretKeyRef:
name: member-secret
key: email-password
- name: JWT_SECRET
valueFrom:
secretKeyRef:
name: member-secret
key: jwt-secret
---
# msa-member Service
apiVersion: v1
kind: Service
metadata:
name: member-service
spec:
selector:
app: msa-member
ports:
- protocol: TCP
port: 80
targetPort: 8080
type: LoadBalancer
---
#######################################################
### app: msa-notice
# msa-notice Deployment: notice-deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: notice-deployment
spec:
replicas: 1
selector:
matchLabels:
app: msa-notice
template:
metadata:
labels:
app: msa-notice
spec:
initContainers:
- name: wait-for-rabbitmq
image: busybox:1.28
command: [ 'sh', '-c', 'until nc -z msa-rabbitmq 5672; do echo waiting for rabbitmq; sleep 2; done;' ]
containers:
- name: msa-notice
image: everyday365/msa-notice:v4
imagePullPolicy: Always
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "100m" # 0.1 CPU core
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: notice-secret
key: DATABASE_URL
- name: RABBITMQ_URL
valueFrom:
configMapKeyRef:
name: notice-config
key: RABBITMQ_URL
- name: RABBITMQ_PORT
valueFrom:
configMapKeyRef:
name: notice-config
key: RABBITMQ_PORT
- name: UNIV_RECOMMENDATION_URL
valueFrom:
configMapKeyRef:
name: notice-config
key: UNIV_RECOMMENDATION_URL
- name: EXTERNAL_RECOMMENDATION_URL
valueFrom:
configMapKeyRef:
name: notice-config
key: EXTERNAL_RECOMMENDATION_URL
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: notice-secret
key: DATABASE_USERNAME
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: notice-secret
key: DATABASE_PASSWORD
- name: RABBITMQ_USERNAME
valueFrom:
secretKeyRef:
name: notice-secret
key: RABBITMQ_USERNAME
- name: RABBITMQ_PASSWORD
valueFrom:
secretKeyRef:
name: notice-secret
key: RABBITMQ_PASSWORD
- name: PORTFOLIO_MS
valueFrom:
configMapKeyRef:
name: notice-config
key: PORTFOLIO_MS
- name: OPENAI_API_KEY
valueFrom:
secretKeyRef:
name: notice-secret
key: OPENAI_API_KEY
---
# msa-notice Service: notice-service
apiVersion: v1
kind: Service
metadata:
name: notice-service
spec:
selector:
app: msa-notice
ports:
- protocol: TCP
port: 8080
targetPort: 8080
type: LoadBalancer
---
#######################################################
### app: msa-portfolio
# msa-portfolio Deployment: portfolio-deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: portfolio-deployment
spec:
replicas: 1
selector: # 디플로이먼트 제어하의 레플리카셋과 파드를 대응시키기 위해 라벨 사용
matchLabels:
app: msa-portfolio
template: # 파드 템플릿
metadata:
labels:
app: msa-portfolio
spec:
containers: # 파드 컨테이너의 사양
- name: msa-portfolio
image: julia2039/msa-portfolio:v4
ports:
- containerPort: 8080
resources:
requests:
memory: "128Mi"
cpu: "100m" # 0.1 CPU core
env:
- name: DATABASE_URL
valueFrom:
secretKeyRef:
name: db-credentials
key: url
- name: DATABASE_USERNAME
valueFrom:
secretKeyRef:
name: db-credentials
key: username
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: db-credentials
key: password
---
# msa-portfolio Service
apiVersion: v1
kind: Service
metadata:
name: portfolio-service
spec:
type: LoadBalancer
ports:
- port: 3001
targetPort: 8080
selector:
app: msa-portfolio
---
#######################################################
### app: msa-recommend
# msa-recommend Deployment
apiVersion: apps/v1
kind: Deployment
metadata:
name: recommend-deployment
spec:
replicas: 1
selector:
matchLabels:
app: msa-recommend
template:
metadata:
labels:
app: msa-recommend
spec:
containers:
- name: msa-recommend
image: hyezis/msa-recommend:latest
ports:
- containerPort: 5000
imagePullSecrets:
- name: regcred
---
# msa-recommend Service
apiVersion: v1
kind: Service
metadata:
name: recommend-service
spec:
type: ClusterIP
selector:
app: msa-recommend
ports:
- protocol: TCP
port: 80
targetPort: 5000
---
## auth-server##
###########################
apiVersion: apps/v1
kind: Deployment
metadata:
name: auth
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: auth
template:
metadata:
labels:
app: auth
spec:
containers:
- name: auth-container
image: everyday365/msa-auth:24.07.04
imagePullPolicy: Always
ports:
- containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: auth-service
spec:
type: ClusterIP
selector:
app: auth
ports:
- protocol: TCP
port: 8080
targetPort: 8080