@@ -343,6 +343,39 @@ Swift as primary object store env vars
343
343
{ {- end -} }
344
344
345
345
346
+ { {/*
347
+ Volumes for a pod, which needs access to nextcloud data.
348
+ */} }
349
+ { {- define " nextcloud.volumes" -} }
350
+ - name: nextcloud-main
351
+ { {- if .Values.persistence.enabled } }
352
+ persistentVolumeClaim:
353
+ claimName: { { if .Values.persistence.existingClaim } }{ { .Values.persistence.existingClaim } }{ {- else } }{ { template " nextcloud.fullname" . } }-nextcloud{ {- end } }
354
+ { {- else } }
355
+ emptyDir: { }
356
+ { {- end } }
357
+ { {- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled } }
358
+ - name: nextcloud-data
359
+ persistentVolumeClaim:
360
+ claimName: { { if .Values.persistence.nextcloudData.existingClaim } }{ { .Values.persistence.nextcloudData.existingClaim } }{ {- else } }{ { template " nextcloud.fullname" . } }-nextcloud-data{ {- end } }
361
+ { {- end } }
362
+ { {- if .Values.nextcloud.configs } }
363
+ - name: nextcloud-config
364
+ configMap:
365
+ name: { { template " nextcloud.fullname" . } }-config
366
+ { {- end } }
367
+ { {- if .Values.nextcloud.phpConfigs } }
368
+ - name: nextcloud-phpconfig
369
+ configMap:
370
+ name: { { template " nextcloud.fullname" . } }-phpconfig
371
+ { {- end } }
372
+ { {- with .Values.nextcloud.extraVolumes } }
373
+ { {- toYaml . } }
374
+ { {- end } }
375
+ { {- end -} }
376
+
377
+
378
+
346
379
{ {/*
347
380
Create volume mounts for the nextcloud container as well as the cron sidecar container.
348
381
*/} }
@@ -374,11 +407,13 @@ Create volume mounts for the nextcloud container as well as the cron sidecar con
374
407
- name: nextcloud-main
375
408
mountPath: /var/www/html/themes
376
409
subPath: { { ternary " themes" (printf " %s/themes" .Values.nextcloud.persistence.subPath) (empty .Values.nextcloud.persistence.subPath) } }
410
+
377
411
{ {- range $key , $value := .Values.nextcloud.configs } }
378
412
- name: nextcloud-config
379
413
mountPath: /var/www/html/config/{ { $key } }
380
414
subPath: { { $key } }
381
- { {- end } }
415
+ { {- end } }{ {/* end-range configs */} }
416
+
382
417
{ {- if .Values.nextcloud.configs } }
383
418
{ {- range $key , $value := .Values.nextcloud.defaultConfigs } }
384
419
{ {- if $value } }
@@ -387,14 +422,17 @@ Create volume mounts for the nextcloud container as well as the cron sidecar con
387
422
subPath: { { $key } }
388
423
{ {- end } }
389
424
{ {- end } }
390
- { {- end } }
391
- { {- if .Values.nextcloud.extraVolumeMounts } }
392
- { { toYaml .Values.nextcloud.extraVolumeMounts } }
393
- { {- end } }
425
+ { {- end } }{ {/* end-if .configs (also defaultConfigs beside config, see above) */} }
426
+
427
+ { {- with .Values.nextcloud.extraVolumeMounts } }
428
+ { { toYaml . } }
429
+ { {- end } }{ {/* end-with extraVolumes*/} }
430
+
394
431
{ {- $nginxEnabled := .Values.nginx.enabled -} }
395
432
{ {- range $key , $value := .Values.nextcloud.phpConfigs } }
396
433
- name: nextcloud-phpconfig
397
434
mountPath: { { $nginxEnabled | ternary (printf " /usr/local/etc/php-fpm.d/%s" $key | quote) (printf " /usr/local/etc/php/conf.d/%s" $key | quote) } }
398
435
subPath: { { $key } }
399
- { {- end } }
436
+ { {- end } }{ {/* end-range phpconfig (with nginx) */} }
437
+
400
438
{ {- end -} }
0 commit comments