Skip to content

Commit 6e8110a

Browse files
authored
build: update Helm chart (#190)
* Update Helm Chart - Add resources - Add a key to change the storage mode - if RWO, the protes pods will be deployed on the same nodes - Update mongo to noble - Add init-script.js configMap - Update secrets - Update env - Update rabbitMQ to 4.1.4-management * Fix variables * Add default resources mongodb * Edit rabbitMQ limits * Fix * Fix readinessProbe timeout * Fix init-script * Add NOTES.txt
1 parent 2f2d889 commit 6e8110a

13 files changed

Lines changed: 173 additions & 49 deletions

deployment/Chart.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: protes
33
description: A proTES Helm chart for Kubernetes
44
type: application
5-
version: 0.1.0
6-
appVersion: 1.16.0
5+
version: 2.0.0
6+
appVersion: 2.0.0

deployment/templates/NOTES.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Elixir Cloud proTES is being deployed!
2+
3+
Once deployed:
4+
5+
1. Access the API via https://{{ .Values.protes.appName }}.{{ .Values.applicationDomain }}/ga4gh/tes/v1/
6+
7+
To test the connection, you can run:
8+
9+
curl -X GET "https://{{ .Values.protes.appName }}.{{ .Values.applicationDomain }}/ga4gh/tes/v1/service-info" -H "Accept: application/json"
10+
11+
2. Access the Swagger UI via https://{{ .Values.protes.appName }}.{{ .Values.applicationDomain }}/ga4gh/tes/v1/ui

deployment/templates/flower/flower-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,5 @@ spec:
1818
- image: {{ .Values.flower.image }}
1919
command: ['flower']
2020
args: ['--broker=amqp://guest:guest@rabbitmq:5672//', '--port=5555', '--basic_auth={{ .Values.flower.basicAuth }}']
21-
name: flower
21+
name: flower
22+
resources: {{- toYaml .Values.flower.resources | nindent 10 }}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: mongo-init-script
5+
data:
6+
init-script.js: |
7+
db = db.getSiblingDB('taskStore');
8+
dbproTES = db.getSiblingDB('{{ tpl .Values.mongodb.secret.databaseName . }}')
9+
10+
dbproTES.createUser({
11+
user: "{{ tpl .Values.mongodb.secret.databaseUser . }}",
12+
pwd: "{{ tpl .Values.mongodb.secret.databasePassword . }}",
13+
roles: [
14+
{
15+
role: "readWrite",
16+
db: "{{ tpl .Values.mongodb.secret.databaseName . }}"
17+
}
18+
]
19+
});
20+
21+
// Create the 'tasks' and 'service_info' collections
22+
// Database configuration from https://github.com/elixir-cloud-aai/proTES/blob/2f2d88915d9948b0d2ffbe6799af01bbc413b00a/pro_tes/config.yaml#L30
23+
db.createCollection('tasks');
24+
db.tasks.createIndex(
25+
{ task_id: 1, worker_id: 1 },
26+
{ unique: true, sparse: true }
27+
);
28+
db.createCollection('service_info');
29+
db.service_info.createIndex(
30+
{ id: 1 }
31+
);
32+
33+
dbproTES.createCollection('runs');
34+
dbproTES.runs.createIndex(
35+
{ run_id: 1, task_id: 1 },
36+
{ unique: true, sparse: true }
37+
);
38+
dbproTES.createCollection('service_info');
39+
dbproTES.service_info.createIndex(
40+
{ id: 1}
41+
);

deployment/templates/mongodb/mongodb-deployment.yaml

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,25 +16,30 @@ spec:
1616
spec:
1717
containers:
1818
- env:
19-
- name: MONGODB_USER
19+
- name: MONGO_INITDB_ROOT_USERNAME
2020
valueFrom:
2121
secretKeyRef:
22-
key: database-user
22+
key: databaseRootUsername
2323
name: {{ .Values.mongodb.appName }}
24-
- name: MONGODB_PASSWORD
24+
- name: MONGO_INITDB_ROOT_PASSWORD
2525
valueFrom:
2626
secretKeyRef:
27-
key: database-password
27+
key: databaseRootPassword
2828
name: {{ .Values.mongodb.appName }}
29-
- name: MONGODB_ADMIN_PASSWORD
29+
- name: MONGO_INITDB_DATABASE
3030
valueFrom:
3131
secretKeyRef:
32-
key: database-admin-password
32+
key: databaseName
3333
name: {{ .Values.mongodb.appName }}
34-
- name: MONGODB_DATABASE
34+
- name: MONGO_APP_USERNAME
3535
valueFrom:
3636
secretKeyRef:
37-
key: database-name
37+
key: databaseUser
38+
name: {{ .Values.mongodb.appName }}
39+
- name: MONGO_APP_PASSWORD
40+
valueFrom:
41+
secretKeyRef:
42+
key: databasePassword
3843
name: {{ .Values.mongodb.appName }}
3944
image: {{ .Values.mongodb.image }}
4045
imagePullPolicy: IfNotPresent
@@ -57,20 +62,23 @@ spec:
5762
- '-i'
5863
- '-c'
5964
- >-
60-
mongo 127.0.0.1:27017/$MONGODB_DATABASE -u $MONGODB_USER -p
61-
$MONGODB_PASSWORD --eval="quit()"
65+
mongosh --host 127.0.0.1:27017 -u $MONGO_INITDB_ROOT_USERNAME -p $MONGO_INITDB_ROOT_PASSWORD --authenticationDatabase admin $MONGO_INITDB_DATABASE --eval="quit()"
6266
failureThreshold: 3
63-
initialDelaySeconds: 3
67+
initialDelaySeconds: 30
6468
periodSeconds: 10
6569
successThreshold: 1
66-
timeoutSeconds: 1
67-
resources:
68-
limits:
69-
memory: 512Mi
70+
timeoutSeconds: 50
71+
resources: {{- toYaml .Values.mongodb.resources | nindent 12 }}
7072
volumeMounts:
71-
- mountPath: /var/lib/mongodb/data
73+
- mountPath: /data/db
7274
name: mongodb-data
75+
- name: init-script
76+
mountPath: /docker-entrypoint-initdb.d/init-script.js
77+
subPath: init-script.js
7378
volumes:
7479
- name: mongodb-data
7580
persistentVolumeClaim:
7681
claimName: {{ .Values.mongodb.appName }}-volume
82+
- name: init-script
83+
configMap:
84+
name: mongo-init-script

deployment/templates/mongodb/mongodb-pvc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ metadata:
44
name: {{ .Values.mongodb.appName }}-volume
55
spec:
66
accessModes:
7-
- ReadWriteMany
7+
- {{ .Values.storageAccessMode }}
88
resources:
99
requests:
1010
storage: {{ .Values.mongodb.volumeSize }}

deployment/templates/mongodb/mongodb-secret.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ type: Opaque
44
metadata:
55
name: {{ .Values.mongodb.appName }}
66
data:
7-
database-admin-password: {{ .Values.mongodb.databaseAdminPassword | b64enc }}
8-
database-name: {{ .Values.mongodb.databaseName | b64enc }}
9-
database-password: {{ .Values.mongodb.databasePassword | b64enc }}
10-
database-user: {{ .Values.mongodb.databaseUser | b64enc }}
7+
{{- range $key, $val := .Values.mongodb.secret }}
8+
"{{ $key }}": "{{ tpl $val $ | b64enc }}"
9+
{{- end }}
10+

deployment/templates/protes/celery-deployment.yaml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ spec:
1616
image: busybox
1717
command: [ 'mkdir' ]
1818
args: [ '-p', '/data/db', '/data/output', '/data/tmp' ]
19+
resources: {{- toYaml .Values.celeryWorker.initResources | nindent 10 }}
1920
volumeMounts:
2021
- mountPath: /data
2122
name: protes-volume
@@ -34,29 +35,23 @@ spec:
3435
- name: MONGO_USERNAME
3536
valueFrom:
3637
secretKeyRef:
37-
key: database-user
38+
key: databaseUser
3839
name: {{ .Values.mongodb.appName }}
3940
- name: MONGO_PASSWORD
4041
valueFrom:
4142
secretKeyRef:
42-
key: database-password
43+
key: databasePassword
4344
name: {{ .Values.mongodb.appName }}
4445
- name: MONGO_DBNAME
4546
valueFrom:
4647
secretKeyRef:
47-
key: database-name
48+
key: databaseName
4849
name: {{ .Values.mongodb.appName }}
4950
- name: RABBIT_HOST
5051
value: {{ .Values.rabbitmq.appName }}
5152
- name: RABBIT_PORT
5253
value: "5672"
53-
resources:
54-
requests:
55-
memory: "512Mi"
56-
cpu: "300m"
57-
limits:
58-
memory: "8Gi"
59-
cpu: "1"
54+
resources: {{- toYaml .Values.celeryWorker.resources | nindent 10 }}
6055
volumeMounts:
6156
- mountPath: /data
6257
name: protes-volume

deployment/templates/protes/protes-deployment.yaml

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,24 @@ spec:
1212
labels:
1313
app: {{ .Values.protes.appName }}
1414
spec:
15+
{{- if eq .Values.storageAccessMode "ReadWriteOnce" }}
16+
affinity:
17+
podAffinity:
18+
requiredDuringSchedulingIgnoredDuringExecution:
19+
- labelSelector:
20+
matchExpressions:
21+
- key: app
22+
operator: In
23+
values:
24+
- {{ .Values.celeryWorker.appName }}
25+
topologyKey: "kubernetes.io/hostname"
26+
{{- end }}
1527
initContainers:
1628
- name: vol-init
1729
image: busybox
1830
command: [ 'mkdir' ]
1931
args: [ '-p', '/data/db', '/data/specs' ]
32+
resources: {{- toYaml .Values.protes.initResources | nindent 10 }}
2033
volumeMounts:
2134
- mountPath: /data
2235
name: protes-volume
@@ -35,22 +48,23 @@ spec:
3548
- name: MONGO_USERNAME
3649
valueFrom:
3750
secretKeyRef:
38-
key: database-user
51+
key: databaseUser
3952
name: {{ .Values.mongodb.appName }}
4053
- name: MONGO_PASSWORD
4154
valueFrom:
4255
secretKeyRef:
43-
key: database-password
56+
key: databasePassword
4457
name: {{ .Values.mongodb.appName }}
4558
- name: MONGO_DBNAME
4659
valueFrom:
4760
secretKeyRef:
48-
key: database-name
61+
key: databaseName
4962
name: {{ .Values.mongodb.appName }}
5063
- name: RABBIT_HOST
5164
value: {{ .Values.rabbitmq.appName }}
5265
- name: RABBIT_PORT
5366
value: "5672"
67+
resources: {{- toYaml .Values.protes.resources | nindent 10 }}
5468
livenessProbe:
5569
tcpSocket:
5670
port: protes-port

deployment/templates/protes/protes-volume.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ metadata:
55
name: {{ .Values.protes.appName}}-volume
66
spec:
77
accessModes:
8-
- ReadWriteMany
8+
- {{ .Values.storageAccessMode }}
99
resources:
1010
requests:
11-
storage: '1Gi'
11+
storage: '1Gi'

0 commit comments

Comments
 (0)