diff --git a/rstudio/templates/_helpers.tpl b/rstudio/templates/_helpers.tpl index 76ff7de..9d46573 100644 --- a/rstudio/templates/_helpers.tpl +++ b/rstudio/templates/_helpers.tpl @@ -77,7 +77,6 @@ Return which PVC to use Creates the bash command for the init containers used to place files and change permissions in the rstudio pods */}} {{- define "rstudio.init-container-commands" -}} -cp -anrL /opt/configs/readonly/rstudio/ /home/; -chown -R rstudio:rstudio /home/rstudio +cp -anrL /opt/configs/readonly/rstudio/. {{ .Values.persistence.mountPath }}; {{- end -}} diff --git a/rstudio/templates/deployment.yaml b/rstudio/templates/deployment.yaml index 9cd3c5b..a39aa99 100644 --- a/rstudio/templates/deployment.yaml +++ b/rstudio/templates/deployment.yaml @@ -24,7 +24,12 @@ spec: initContainers: - name: {{ .Chart.Name }}-init-mounts image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" - command: ['sh', '-c', {{ include "rstudio.init-container-commands" . | squote }}] + command: [ + 'sh', '-c', + '{{- if .Values.extraInitCommands -}} + {{- tpl .Values.extraInitCommands $ | nindent 13 }}; + {{- end -}} + {{ include "rstudio.init-container-commands" . }}'] volumeMounts: {{- range $entry := .Values.mutableConfigs }} {{ if $entry -}} @@ -35,7 +40,9 @@ spec: {{- end }} - name: rstudio-data mountPath: {{.Values.persistence.mountPath}} - subPath: rstudio + {{- if .Values.persistence.subPath }} + subPath: {{ .Values.persistence.subPath }} + {{- end }} {{- if .Values.extraVolumeMounts }} {{- .Values.extraVolumeMounts | toYaml | nindent 12 }} {{- end }} @@ -72,7 +79,9 @@ spec: {{- end }} - name: rstudio-data mountPath: {{.Values.persistence.mountPath}} - subPath: rstudio + {{- if .Values.persistence.subPath }} + subPath: {{ .Values.persistence.subPath }} + {{- end }} {{- if .Values.extraVolumeMounts }} {{- .Values.extraVolumeMounts | toYaml | nindent 12 }} {{- end }} @@ -106,4 +115,4 @@ spec: {{- end }} {{- if .Values.extraVolumes }} {{- .Values.extraVolumes | toYaml | nindent 8 }} - {{- end }} \ No newline at end of file + {{- end }} diff --git a/rstudio/values.yaml b/rstudio/values.yaml index c17b147..77e0203 100644 --- a/rstudio/values.yaml +++ b/rstudio/values.yaml @@ -79,6 +79,8 @@ persistence: accessMode: ReadWriteMany size: 10Gi mountPath: /home/rstudio + # SubPath of directory to mount/create in the volume + # subPath: rstudio # extraVolumes: # - name: shared-data @@ -96,3 +98,7 @@ useSecretConfigs: false # subPath: ".rstudio/monitored/user-settings/" # contents: | # initialWorkingDirectory="/opt/project/shared-data" + +# extraInitCommands: | +# cp -anrL /etc/skel/. /gvl/projects/current/ +# /galaxy/server/extra/mapped/script.sh