Skip to content

Commit 6cae19c

Browse files
authored
Merge pull request #508 from galaxyproject/uid
Updates for a different default galaxy user system uid
2 parents 70ea3f8 + 0c5f938 commit 6cae19c

File tree

4 files changed

+17
-18
lines changed

4 files changed

+17
-18
lines changed

galaxy/templates/deployment-nginx.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ spec:
2929
{{- end }}
3030
serviceAccountName: {{ include "galaxy.serviceAccountName" . }}
3131
securityContext:
32-
{{- toYaml .Values.securityContext | nindent 8 }}
32+
fsGroup: {{ .Values.securityContext.fsGroup }}
3333
{{- if .Values.webHandlers.podSpecExtra -}}
3434
{{- tpl (toYaml .Values.webHandlers.podSpecExtra) . | nindent 6 }}
3535
{{- end }}

galaxy/templates/deployment-tusd.yaml

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ spec:
3232
{{- end }}
3333
serviceAccountName: {{ include "galaxy.serviceAccountName" . }}
3434
securityContext:
35-
{{- toYaml .Values.tusd.securityContext | nindent 8 }}
35+
runAsUser: {{ default .Values.securityContext.runAsUser .Values.tusd.securityContext.runAsUser }}
36+
runAsGroup: {{ default .Values.securityContext.runAsGroup .Values.tusd.securityContext.runAsGroup }}
37+
fsGroup: {{ default .Values.securityContext.fsGroup .Values.tusd.securityContext.fsGroup }}
3638
{{- if .Values.tusd.podSpecExtra -}}
3739
{{- tpl (toYaml .Values.webHandlers.podSpecExtra) . | nindent 6 }}
3840
{{- end }}

galaxy/templates/jobs-init.yaml

+4-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ spec:
1919
checksum/galaxy_extras: {{ include (print $.Template.BasePath "/configmap-extra-files.yaml") . | sha256sum }}
2020
spec:
2121
securityContext:
22-
{{- toYaml .Values.setupJob.securityContext | nindent 8 }}
22+
runAsUser: {{ default .Values.securityContext.runAsUser .Values.setupJob.securityContext.runAsUser }}
23+
runAsGroup: {{ default .Values.securityContext.runAsGroup .Values.setupJob.securityContext.runAsGroup }}
24+
fsGroup: {{ default .Values.securityContext.fsGroup .Values.setupJob.securityContext.fsGroup }}
2325
{{- with .Values.nodeSelector }}
2426
nodeSelector:
2527
{{- toYaml . | nindent 8 }}
@@ -29,7 +31,7 @@ spec:
2931
- name: {{ .Chart.Name }}-wait-postgres
3032
image: {{ .Values.jobs.init.image.repository }}:{{ .Values.jobs.init.image.tag }}
3133
imagePullPolicy: {{ .Values.jobs.init.image.pullPolicy }}
32-
command: ['sh', '-c', 'echo Chown mount path; chown 101:101 {{ .Values.persistence.mountPath }}; echo Begin waiting for postgres; until nc -z -w3 {{ template "galaxy-postgresql.servicename" . }} 5432; do echo waiting for galaxy-postgres service; sleep 1; done; echo done;']
34+
command: ['sh', '-c', 'echo Chown mount path; chown {{ .Values.securityContext.fsUser}}:{{ .Values.securityContext.fsGroup }} {{ .Values.persistence.mountPath }}; echo Begin waiting for postgres; until nc -z -w3 {{ template "galaxy-postgresql.servicename" . }} 5432; do echo waiting for galaxy-postgres service; sleep 1; done; echo done;']
3335
volumeMounts:
3436
- name: galaxy-data
3537
mountPath: {{ .Values.persistence.mountPath }}

galaxy/values.yaml

+9-14
Original file line numberDiff line numberDiff line change
@@ -180,8 +180,12 @@ rbac:
180180
enabled: true
181181

182182
securityContext:
183+
#- UID of the system user used by jobs. This user must exist in the container.
184+
runAsUser: 10001
185+
#- GID of the system group used by jobs. This group must exist in the container.
186+
runAsGroup: 10001
183187
#- Security context and file system group used by jobs.
184-
fsGroup: 101
188+
fsGroup: 10001
185189

186190
#- Configure the PVC used by Galaxy for local storage.
187191
persistence:
@@ -211,13 +215,7 @@ extraVolumeMounts: []
211215
setupJob:
212216
#- create the database
213217
createDatabase: true
214-
securityContext:
215-
#- the setup jobs will run as this user
216-
runAsUser: 101
217-
#- the `runAsUser` will belong to this group.
218-
runAsGroup: 101
219-
#- the filesystem group
220-
fsGroup: 101
218+
securityContext: {}
221219
ttlSecondsAfterFinished: 300
222220
downloadToolConfs:
223221
enabled: true
@@ -482,8 +480,8 @@ configs:
482480
{{- end }}
483481
k8s_namespace: "{{ .Release.Namespace }}"
484482
k8s_galaxy_instance_id: "{{ .Release.Name }}"
485-
k8s_fs_group_id: "101"
486-
k8s_supplemental_group_id: "101"
483+
k8s_fs_group_id: "{{ .Values.securityContext.fsGroup }}"
484+
k8s_supplemental_group_id: "{{ .Values.securityContext.fsGroup }}"
487485
k8s_pull_policy: IfNotPresent
488486
k8s_cleanup_job: onsuccess
489487
k8s_job_ttl_secs_after_finished: 90
@@ -766,10 +764,7 @@ tusd:
766764
annotations: {}
767765
podAnnotations: {}
768766
podSpecExtra: {}
769-
securityContext:
770-
runAsUser: 101
771-
runAsGroup: 101
772-
fsGroup: 101
767+
securityContext: {}
773768
image:
774769
repository: tusproject/tusd
775770
tag: v1.13.0

0 commit comments

Comments
 (0)