-
Notifications
You must be signed in to change notification settings - Fork 0
/
deployment-nfs.yaml
541 lines (529 loc) · 11.4 KB
/
deployment-nfs.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
#
# postgres
#
# postgres pod (migrate to a NFS Volume)
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
image: postgres:11-alpine
ports:
- containerPort: 5432
env:
- name: POSTGRES_USER
value: "xxusernamexx"
- name: POSTGRES_PASSWORD
value: "xxpasswordxx"
- name: POSTGRES_DB
value: "xxdbxx"
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: db-data
volumes:
- name: db-data
persistentVolumeClaim:
claimName: postgres-data-pvc
# command: # modified
# - /bin/bash
# - -c
# args:
# - sleep 3600
# command: [ "/usr/local/bin/docker-entrypoint.sh", "-c 'shared_buffers=256MB'", "-c 'max_locks_per_transaction=1024'" ]
# command: [ "/usr/local/bin/docker-entrypoint.sh" ]
#args: [ "-c 'shared_buffers=256MB' -c 'max_locks_per_transaction=1024'" ]
---
# service
kind: Service
apiVersion: v1
metadata:
name: postgres
spec:
selector:
app: postgres
ports:
- protocol: TCP
port: 5432
targetPort: 5432
---
#
# elastic search
#
# elastic search pod (migrate to a NFS Volume)
# memlocks limit not included.
apiVersion: apps/v1
kind: Deployment
metadata:
name: elasticsearch
labels:
app: elasticsearch
spec:
replicas: 1
selector:
matchLabels:
app: elasticsearch
template:
metadata:
labels:
app: elasticsearch
spec:
containers:
- name: es-image
image: docker.elastic.co/elasticsearch/elasticsearch:7.15.2
ports:
- containerPort: 9200
env:
- name: cluster.name
value: "molgenis"
- name: bootstrap.memory_lock
value: "true"
- name: ES_JAVA_OPTS
value: "-Xms1024m -Xmx1024m"
- name: discovery.type
value: "single-node"
- name: xpack.security.enabled
value: "false"
volumeMounts:
- mountPath: /usr/share/elasticsearch/data
name: es-data
volumes:
- name: es-data
persistentVolumeClaim:
claimName: es-data-pvc
---
# service
kind: Service
apiVersion: v1
metadata:
name: es
spec:
selector:
app: elasticsearch
ports:
- protocol: TCP
port: 9200
targetPort: 9200
---
#
# Kibana
#
# Not included:
# profiles:
# - audit
apiVersion: apps/v1
kind: Deployment
metadata:
name: kibana
labels:
app: kibana
spec:
replicas: 1
selector:
matchLabels:
app: kibana
template:
metadata:
labels:
app: kibana
spec:
containers:
- name: kibanad-image
image: docker.elastic.co/kibana/kibana:7.15.2
ports:
- containerPort: 5601
env:
- name: DASHBOARD_FILE
value: "https://raw.githubusercontent.com/molgenis/molgenis/master/.kibana/dashboard.json"
---
# service
kind: Service
apiVersion: v1
metadata:
name: kibana
spec:
selector:
app: kibana
ports:
- protocol: TCP
port: 5601
targetPort: 5601
---
#
# Kibana dashboard
#
#
# securityContext:
# runAsUser: 0
# volumeMounts:
# - mountPath: /root/dashboard
# name: kbd-data
apiVersion: apps/v1
kind: Deployment
metadata:
name: kibana-dashboard
labels:
app: kibana-dashboard
spec:
replicas: 1
selector:
matchLabels:
app: kibana-dashboard
template:
metadata:
labels:
app: kibana-dashboard
spec:
restartPolicy: Always
volumes:
- name: kbd-data
persistentVolumeClaim:
claimName: kibanad-data-pvc
containers:
- name: kibanad-image
image: docker.elastic.co/kibana/kibana:7.15.2
env:
- name: DASHBOARD_FILE
value: "https://raw.githubusercontent.com/molgenis/molgenis/master/.kibana/dashboard.json"
---
#
# OpenCPU
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: opencpu
labels:
app: opencpu
spec:
replicas: 1
selector:
matchLabels:
app: opencpu
template:
metadata:
labels:
app: opencpu
spec:
containers:
- name: opencpu-image
image: molgenis/opencpu:opencpu-release-2019-03-20_12-07-11
ports:
- containerPort: 8004
---
# service
kind: Service
apiVersion: v1
metadata:
name: opencpu
spec:
selector:
app: opencpu
ports:
- protocol: TCP
port: 8004
targetPort: 8004
---
#
# MINIO
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: minio
labels:
app: minio
spec:
replicas: 1
selector:
matchLabels:
app: minio
template:
metadata:
labels:
app: minio
spec:
containers:
- name: minio-image
image: bitnami/minio:2019.4.23
volumeMounts:
- mountPath: /data
name: minio-data
env:
- name: MINIO_ACCESS_KEY
value: "xxminiokeyxx"
- name: MINIO_SECRET_KEY
value: "xxminiosecretxx"
command:
- /bin/bash
- -c
args:
- minio server /data
volumes:
- name: minio-data
persistentVolumeClaim:
claimName: minio-data-pvc
---
# service
kind: Service
apiVersion: v1
metadata:
name: minio
spec:
selector:
app: minio
ports:
- protocol: TCP
port: 9000
targetPort: 9000
---
########### MOLGENIS ######
#
# molgenis server
#
# Volume app-data (migrate to a NFS Volume)
#
# molgenis pod (migrate to a NFS Volume)
apiVersion: apps/v1
kind: Deployment
metadata:
name: molgenis
labels:
app: molgenis
spec:
replicas: 1
selector:
matchLabels:
app: molgenis
template:
metadata:
labels:
app: molgenis
spec:
restartPolicy: Always
securityContext:
runAsUser: 0
volumes:
- name: app-data
persistentVolumeClaim:
claimName: app-data-pvc
- name: audit-log
persistentVolumeClaim:
claimName: audit-log-pvc
- name: server-conf
configMap:
name: tomcat-serverxml
items:
- key: server.xml
path: server.xml
- name: web-conf
configMap:
name: tomcat-webxml
items:
- key: web.xml
path: web.xml
containers:
- name: molgenis-app
image: molgenis/molgenis-app:10.1.0
ports:
- containerPort: 8080
name: molgenis-port
volumeMounts:
- mountPath: /home/molgenis/data
name: app-data
- mountPath: /home/molgenis/audit
name: audit-log
- mountPath: /usr/local/tomcat/webapps.dist/docs/WEB-INF/web.xml
subPath: web.xml
name: web-conf
- mountPath: /usr/local/tomcat/conf/server.xml
subPath: server.xml
name: server-conf
env:
- name: environment
value: "production"
- name: molgenis.home
value: "/home/molgenis"
- name: mail.username
value: "[email protected]"
- name: mail.password
value: "xxxxxxxxxx"
- name: opencpu.uri.host
value: "opencpu"
- name: elasticsearch.hosts
value: "es:9200"
- name: db_uri
value: "jdbc:postgresql://postgres:5432/molgenis"
- name: db_user
value: "xxxxxxx"
- name: db_password
value: "xxxxxxx"
- name: admin.password
value: "axxxxxx"
- name: MINIO_BUCKET_NAME
value: "xxxxxxx"
- name: MINIO_ENDPOINT
value: "http://minio:9000"
- name: MINIO_ACCESS_KEY
value: "xxxxxxx"
- name: MINIO_SECRET_KEY
value: "xxxxxxx"
- name: MOLGENIS_MAX_FILE_MB
value: "150"
- name: audit.log.path
value: "/home/molgenis/audit/audit.log"
# value: "jdbc:postgresql://postgres/molgenis"
# - name: CATALINA_OPTS
# value: "Xmx1g"
# - name: createDirs # supposedly for tomcat configuration, not working
# value: "false"
---
# service
kind: Service
apiVersion: v1
metadata:
name: molgenis
spec:
selector:
app: molgenis
type: NodePort
ports:
- protocol: TCP
nodePort: 8080
port: 8080
name: molgenis-np
targetPort: 8080
---
#
# Front-end
#
apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
labels:
app: frontend
spec:
replicas: 1
selector:
matchLabels:
app: frontend
template:
metadata:
labels:
app: frontend
spec:
containers:
- name: molgenis-frontend
image: molgenis/molgenis-frontend:10.1.0
ports:
- containerPort: 80
# command:
# - /bin/bash
# - -c
# args:
# - sleep 3600
# /usr/share/nginx/html
volumeMounts:
- mountPath: /usr/share/nginx/html
name: frontend-data
- mountPath: /etc/nginx/proxy.d/backend.conf
subPath: backend.conf
name: backend-conf
- mountPath: /etc/nginx/nginx.conf
subPath: nginx.conf
name: nginx-conf
- mountPath: /etc/nginx/proxy.d/lts.conf
subPath: lts.conf
name: lts-conf
volumes:
- name: frontend-data
persistentVolumeClaim:
claimName: frontend-data-pvc
- name: backend-conf
configMap:
name: backend
items:
- key: backend.conf
path: backend.conf
- name: nginx-conf
configMap:
name: nginxconf
items:
- key: nginx.conf
path: nginx.conf
- name: lts-conf
configMap:
name: ltsconf
items:
- key: lts.conf
path: lts.conf
---
# service
kind: Service
apiVersion: v1
metadata:
name: frontend
spec:
selector:
app: frontend
type: NodePort
ports:
- protocol: TCP
nodePort: 22896
port: 80
name: frontend-port
targetPort: 80
- protocol: TCP
nodePort: 30010
port: 8000
name: frontend
targetPort: 80
---
#cancerimage.eu
#pgc-profe.info
########### INGRESS ######
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cancerimage-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/backend-protocol: HTTP
#nginx.ingress.kubernetes.io/configuration-snippet: |
# rewrite /molgenis http://catalogue.ramses.i3m.upv.es/ permanent;
# rewrite /catalog http://catalogue.ramses.i3m.upv.es/ permanent;
#nginx.ingress.kubernetes.io/rewrite-target: /$2
#nginx.ingress.kubernetes.io/use-regex: 'true'
cert-manager.io/cluster-issuer: letsencrypt-prod
spec:
tls:
#- hosts:
# - catalogue.ramses.i3m.upv.es
# secretName: catalogue.ramses.i3m.upv.es
- hosts:
- catalogue.eucaim.cancerimage.eu
secretName: catalogue.eucaim.cancerimage.eu
rules:
- host: catalogue.eucaim.cancerimage.eu
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: frontend
port:
number: 80