-
Notifications
You must be signed in to change notification settings - Fork 419
/
yaslocal.yaml
609 lines (582 loc) · 11.5 KB
/
yaslocal.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
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: yas-ingress
spec:
ingressClassName: nginx
rules:
- host: api.yas.local
http:
paths:
- path: /swagger-ui
pathType: Prefix
backend:
service:
name: swagger-ui
port:
number: 80
- path: /media
pathType: Prefix
backend:
service:
name: media
port:
number: 80
- path: /product
pathType: Prefix
backend:
service:
name: product
port:
number: 80
- host: storefront
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: storefront
port:
number: 80
- host: backoffice
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: backoffice
port:
number: 80
- host: identity
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: identity
port:
number: 80
- host: pgadmin.yas.local
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: pgadmin
port:
number: 80
- host: jaeger
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: jaeger
port:
number: 80
---
apiVersion: v1
kind: Service
metadata:
name: storefront
labels:
app: storefront
spec:
selector:
app: storefront
ports:
- name: http
port: 80
targetPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: backoffice
labels:
app: backoffice
spec:
selector:
app: backoffice
ports:
- name: http
port: 80
targetPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: swagger-ui
labels:
app: swagger-ui
spec:
selector:
app: swagger-ui
ports:
- name: http
port: 80
targetPort: 8080
---
apiVersion: v1
kind: Service
metadata:
name: media
labels:
app: media
spec:
selector:
app: media
ports:
- name: http
port: 80
---
apiVersion: v1
kind: Service
metadata:
name: product
labels:
app: product
spec:
selector:
app: product
ports:
- name: http
port: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: storefront
spec:
minReadySeconds: 30
selector:
matchLabels:
app: storefront
replicas: 1
template:
metadata:
labels:
app: storefront
spec:
containers:
- name: storefront-bff
image: ghcr.io/nashtech-garage/yas-storefront-bff:latest
env:
- name: SERVER_PORT
value: "80"
- name: SPRING_PROFILES_ACTIVE
value: "prod"
- name: SPRING_SLEUTH_OTEL_EXPORTER_OTLP_ENDPOINT
value: http://jaeger:4317
ports:
- name: http
containerPort: 80
- name: storefront
image: ghcr.io/nashtech-garage/yas-storefront:latest
ports:
- name: http
containerPort: 3000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: backoffice
spec:
minReadySeconds: 30
selector:
matchLabels:
app: backoffice
replicas: 1
template:
metadata:
labels:
app: backoffice
spec:
containers:
- name: backoffice-bff
image: ghcr.io/nashtech-garage/yas-backoffice-bff:latest
env:
- name: SERVER_PORT
value: "80"
- name: SPRING_PROFILES_ACTIVE
value: "prod"
- name: SPRING_SLEUTH_OTEL_EXPORTER_OTLP_ENDPOINT
value: http://jaeger:4317
ports:
- name: http
containerPort: 80
- name: backoffice
image: ghcr.io/nashtech-garage/yas-backoffice:latest
ports:
- name: http
containerPort: 3000
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: swagger-ui
spec:
selector:
matchLabels:
app: swagger-ui
replicas: 1
template:
metadata:
labels:
app: swagger-ui
spec:
containers:
- name: swagger-ui
image: swaggerapi/swagger-ui
env:
- name: BASE_URL
value: "/swagger-ui"
- name: URLS
value: "[{ url: 'http://api.yas.local/product/v3/api-docs', name: 'Product' },{ url: 'http://api.yas.local/media/v3/api-docs', name: 'Media' }]"
- name: OAUTH_CLIENT_ID
value: "swagger-ui"
- name: OAUTH_USE_PKCE
value: "true"
ports:
- name: http
containerPort: 8080
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: media
spec:
minReadySeconds: 30
selector:
matchLabels:
app: media
replicas: 1
template:
metadata:
labels:
app: media
spec:
containers:
- name: media
image: ghcr.io/nashtech-garage/yas-media:latest
env:
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://postgres:5432/media"
- name: SERVER_SERVLET_CONTEXT_PATH # a hacky way to fix sub path behind nginx
value: "/media"
- name: YAS_PUBLICURL
value: "http://api.yas.local/media"
- name: SERVER_PORT
value: "80"
- name: SPRING_SLEUTH_OTEL_EXPORTER_OTLP_ENDPOINT
value: http://jaeger:4317
ports:
- name: http
containerPort: 80
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: product
spec:
minReadySeconds: 30
selector:
matchLabels:
app: product
replicas: 1
template:
metadata:
labels:
app: product
spec:
containers:
- name: product
image: ghcr.io/nashtech-garage/yas-product:latest
env:
- name: SPRING_DATASOURCE_URL
value: "jdbc:postgresql://postgres:5432/product"
- name: SERVER_SERVLET_CONTEXT_PATH
value: "/product"
- name: YAS_SERVICES_MEDIA
value: "http://media/media"
- name: SERVER_PORT
value: "80"
- name: SPRING_SLEUTH_OTEL_EXPORTER_OTLP_ENDPOINT
value: http://jaeger:4317
ports:
- name: http
containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: identity
labels:
app: identity
spec:
ports:
- name: http
port: 80
targetPort: 8080
selector:
app: keycloak
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: keycloak
labels:
app: keycloak
spec:
replicas: 1
selector:
matchLabels:
app: keycloak
template:
metadata:
labels:
app: keycloak
spec:
containers:
- name: keycloak
image: quay.io/keycloak/keycloak:16.1.0
env:
- name: KEYCLOAK_USER
value: "admin"
- name: KEYCLOAK_PASSWORD
value: "admin"
- name: PROXY_ADDRESS_FORWARDING
value: "true"
- name: DB_VENDOR
value: "POSTGRES"
- name: DB_USER
value: "admin"
- name: DB_PASSWORD
value: "admin"
- name: DB_ADDR
value: "postgres"
- name: DB_DATABASE
value: "keycloak"
ports:
- name: http
containerPort: 8080
readinessProbe:
httpGet:
path: /auth/realms/master
port: 8080
---
apiVersion: v1
kind: Service
metadata:
name: postgres
labels:
app: postgres
spec:
type: NodePort
ports:
- port: 5432
nodePort: 30007
selector:
app: postgres
---
apiVersion: v1
kind: Service
metadata:
name: pgadmin
labels:
app: pgadmin
spec:
ports:
- name: http
port: 80
selector:
app: postgres
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: postgres
labels:
app: postgres
spec:
replicas: 1
selector:
matchLabels:
app: postgres
template:
metadata:
labels:
app: postgres
spec:
containers:
- name: postgres
image: postgres
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
value: "admin"
- name: POSTGRES_PASSWORD
value: "admin"
volumeMounts:
- mountPath: "/var/lib/postgresql/data"
name: postgredb
- name: pgadmin
image: dpage/pgadmin4
ports:
- containerPort: 80
env:
- name: PGADMIN_DEFAULT_EMAIL
value: [email protected]
- name: PGADMIN_DEFAULT_PASSWORD
value: "admin"
volumeMounts:
- mountPath: "/var/lib/pgadmin"
name: pgadmin
volumes:
- name: postgredb
persistentVolumeClaim:
claimName: postgres-pv-claim
- name: pgadmin
persistentVolumeClaim:
claimName: pgadmin-pv-claim
---
apiVersion: v1
kind: Service
metadata:
name: jaeger
labels:
app: jaeger
spec:
type: NodePort
ports:
- name: web
port: 80
targetPort: 16686
- name: otlpcollectorgprc
port: 4317
nodePort: 30017
- name: otlpcollectorhttp
port: 4318
nodePort: 30018
selector:
app: jaeger
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jaeger
spec:
minReadySeconds: 30
selector:
matchLabels:
app: jaeger
replicas: 1
template:
metadata:
labels:
app: jaeger
spec:
containers:
- name: jaeger
image: jaegertracing/all-in-one:1.36
env:
- name: COLLECTOR_ZIPKIN_HOST_PORT
value: "9411"
- name: COLLECTOR_OTLP_ENABLED
value: "true"
ports:
- containerPort: 6831
- containerPort: 6832
- containerPort: 5778
- containerPort: 16686
- containerPort: 4317
- containerPort: 4318
- containerPort: 14250
- containerPort: 14268
- containerPort: 14269
- containerPort: 9411
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: postgres-pv-volume
labels:
type: local
spec:
storageClassName: local-storage
volumeMode: Filesystem
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
local:
path: "/run/desktop/mnt/host/c/k8s-yas-data/postgres"
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- docker-desktop
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: pgadmin-pv-volume
labels:
type: local
spec:
storageClassName: local-storage
volumeMode: Filesystem
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
local:
path: "/run/desktop/mnt/host/c/k8s-yas-data/pgadmin"
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- docker-desktop
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-pv-claim
spec:
storageClassName: local-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: pgadmin-pv-claim
spec:
storageClassName: local-storage
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: local-storage
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer