Skip to content

Commit 9f90c82

Browse files
committed
add temp folder and extra volumes
fixes #4
1 parent 1eaf592 commit 9f90c82

File tree

2 files changed

+37
-10
lines changed

2 files changed

+37
-10
lines changed

templates/deployment.yaml

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ spec:
2222
imagePullSecrets:
2323
{{- toYaml . | nindent 8 }}
2424
{{- end }}
25+
securityContext:
26+
runAsUser: {{ .Values.userid }}
27+
runAsGroup: {{ .Values.groupid }}
2528
initContainers:
2629
- name: check-mongo
2730
image: "{{ $.Values.image.checks }}"
@@ -33,15 +36,23 @@ spec:
3336
name: {{ .Release.Name }}
3437
key: mongodb-uri
3538
{{- if not (or .Values.storage.s3 .Values.minio.enabled) }}
36-
- name: data-chown
37-
command: [chown, "{{ .Values.userid }}:{{ .Values.groupid }}", /home/clowder/data]
39+
- name: chown-data-folder
3840
image: busybox:latest
41+
command: ["/bin/sh"]
42+
args:
43+
- -c
44+
- >-
45+
mkdir {{ .Values.tempfolder }} &&
46+
chown "{{ .Values.userid }}:{{ .Values.groupid }}" /home/clowder/data {{ .Values.tempfolder }}
3947
securityContext:
4048
runAsUser: 0
4149
runAsGroup: 0
4250
volumeMounts:
4351
- name: data
4452
mountPath: /home/clowder/data
53+
{{- with .Values.extraVolumeMounts }}
54+
{{- . | toYaml | nindent 10 }}
55+
{{- end }}
4556
{{- end }}
4657
{{- if .Values.users }}
4758
{{- range $index, $element := .Values.users }}
@@ -73,16 +84,14 @@ spec:
7384
value: {{ .admin | quote }}
7485
{{- end }}
7586
{{- end }}
76-
securityContext:
77-
runAsUser: {{ .Values.userid }}
78-
runAsGroup: {{ .Values.groupid }}
7987
containers:
8088
- name: {{ .Chart.Name }}
8189
image: "{{ .Values.image.repository }}/{{ .Values.image.name }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
8290
imagePullPolicy: {{ .Values.image.pullPolicy }}
8391
command:
8492
- /home/clowder/clowder.sh
8593
- -mem {{ .Values.memory }}
94+
- -Djava.io.tmpdir={{ .Values.tempfolder }}
8695
{{- range .Values.extraOptions }}
8796
- {{ . }}
8897
{{- end }}
@@ -141,6 +150,9 @@ spec:
141150
- name: data
142151
mountPath: /home/clowder/data
143152
{{- end }}
153+
{{- with .Values.extraVolumeMounts }}
154+
{{- . | toYaml | nindent 12 }}
155+
{{- end }}
144156
livenessProbe:
145157
tcpSocket:
146158
port: clowder
@@ -162,15 +174,18 @@ spec:
162174
path: custom.conf
163175
- key: play.plugins
164176
path: play.plugins
165-
{{- if not (or .Values.storage.s3 .Values.minio.enabled) }}
177+
{{- if not (or .Values.storage.s3 .Values.minio.enabled) }}
166178
- name: data
167179
persistentVolumeClaim:
168-
{{- if $.Values.persistence.existingClaim }}
180+
{{- if $.Values.persistence.existingClaim }}
169181
claimName: {{ $.Values.persistence.existingClaim }}
170-
{{- else }}
182+
{{- else }}
171183
claimName: {{ include "clowder.fullname" . }}-data
172-
{{- end }}
173-
{{- end }}
184+
{{- end }}
185+
{{- end }}
186+
{{- with .Values.extraVolumes }}
187+
{{- . | toYaml | nindent 8 }}
188+
{{- end }}
174189
{{- with .Values.nodeSelector }}
175190
nodeSelector:
176191
{{- toYaml . | nindent 8 }}

values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ userid: 10001
8080
## to a shared folder.
8181
groupid: 0
8282

83+
## tempfolder is the place where clowder will safe the files when they are uploaded. Best
84+
## is for this to be on the same volume as the final storage, or on a fast storage.
85+
tempfolder: /home/clowder/data/tmp/
8386

8487
# ----------------------------------------------------------------------
8588
# Configure the ingress object to hook into existing infastructure
@@ -216,6 +219,15 @@ persistence:
216219
## Annotations
217220
annotations: {}
218221

222+
# Add additional volumes and mounts, for example to hold data transfered externally of clowder
223+
extraVolumes: []
224+
# - name: sites
225+
# persistentVolumeClaim:
226+
# claimName: clowder-sites
227+
extraVolumeMounts: []
228+
# - name: sites
229+
# mountPath: /home/clowder/sites
230+
# readOnly: true
219231

220232
# ----------------------------------------------------------------------
221233
monitor:

0 commit comments

Comments
 (0)