Skip to content

Commit

Permalink
Parameterize the image used for init containers.
Browse files Browse the repository at this point in the history
  • Loading branch information
ksuderman committed Sep 6, 2024
1 parent 59c68b1 commit 6ccbb87
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
12 changes: 8 additions & 4 deletions galaxy/templates/jobs-init.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ spec:
restartPolicy: OnFailure
initContainers:
- name: {{ .Chart.Name }}-wait-postgres
image: alpine:3.16
image: {{ .Values.jobs.init.image.repository }}:{{ .Values.jobs.init.image.tag }}
imagePullPolicy: {{ .Values.jobs.init.image.pullPolicy }}
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.fullname" . }} 5432; do echo waiting for galaxy-postgres service; sleep 1; done; echo done;']
volumeMounts:
- name: galaxy-data
Expand Down Expand Up @@ -198,7 +199,8 @@ spec:
{{- end }}
{{ if .Values.setupJob.downloadToolConfs.enabled }}
- name: {{ .Chart.Name }}-init-cloud-repo
image: alpine:3.16
image: {{ .Values.jobs.init.image.repository }}:{{ .Values.jobs.init.image.tag }}
imagePullPolicy: {{ .Values.jobs.init.image.pullPolicy }}
command: ['sh', '-c', '{{- include "galaxy.extract-archive-if-changed-command" (dict "extractPath" .Values.setupJob.downloadToolConfs.volume.mountPath "downloadUrl" .Values.setupJob.downloadToolConfs.archives.startup) -}} && echo "Done" > /galaxy/server/config/mutable/init_clone_done_{{.Release.Revision}}']
volumeMounts:
- name: galaxy-data
Expand All @@ -208,14 +210,16 @@ spec:
mountPath: /galaxy/server/config/mutable/
subPath: config
- name: {{ .Chart.Name }}-init-cloud-repo-partial
image: alpine:3.16
image: {{ .Values.jobs.init.image.repository }}:{{ .Values.jobs.init.image.tag }}
imagePullPolicy: {{ .Values.jobs.init.image.pullPolicy }}
command: ['sh', '-c', '{{- include "galaxy.extract-archive-if-changed-command" (dict "extractPath" .Values.setupJob.downloadToolConfs.volume.mountPath "downloadUrl" .Values.setupJob.downloadToolConfs.archives.running) -}}']
volumeMounts:
- name: galaxy-data
mountPath: {{ .Values.setupJob.downloadToolConfs.volume.mountPath }}
subPath: {{ .Values.setupJob.downloadToolConfs.volume.subPath }}
- name: {{ .Chart.Name }}-init-cloud-repo-full
image: alpine:3.16
image: {{ .Values.jobs.init.image.repository }}:{{ .Values.jobs.init.image.tag }}
imagePullPolicy: {{ .Values.jobs.init.image.pullPolicy }}
command: ['sh', '-c', '{{- include "galaxy.extract-archive-if-changed-command" (dict "extractPath" .Values.setupJob.downloadToolConfs.volume.mountPath "downloadUrl" .Values.setupJob.downloadToolConfs.archives.full) -}}']
volumeMounts:
- name: galaxy-data
Expand Down
6 changes: 6 additions & 0 deletions galaxy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ configs:
#- Additional dynamic rules to map into the container.
jobs:
init:
#- The Docker image to use for the init containers
image:
repository: alpine
tag: 3.16
pullPolicy: IfNotPresent
priorityClass:
#- Assign a [priorityClass](https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/#priorityclass) to the dispatched jobs.
enabled: true
Expand Down

0 comments on commit 6ccbb87

Please sign in to comment.