_persistence.tpl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. {{- define "filebrowser.persistence" -}}
  2. {{- $configBasePath := "/config" }}
  3. persistence:
  4. config:
  5. enabled: true
  6. type: {{ .Values.filebrowserStorage.config.type }}
  7. datasetName: {{ .Values.filebrowserStorage.config.datasetName | default "" }}
  8. hostPath: {{ .Values.filebrowserStorage.config.hostPath | default "" }}
  9. targetSelector:
  10. filebrowser:
  11. filebrowser:
  12. mountPath: {{ $configBasePath }}
  13. 02-init-config:
  14. mountPath: {{ $configBasePath }}
  15. 01-permissions:
  16. mountPath: /mnt/directories/config
  17. {{- if not .Values.filebrowserStorage.additionalStorages -}}
  18. {{- fail "Filebrowser - Expected at least 1 additional storage" -}}
  19. {{- end -}}
  20. {{- range $idx, $storage := .Values.filebrowserStorage.additionalStorages }}
  21. {{- if not (hasPrefix "/" $storage.mountPath) -}}
  22. {{- fail (printf "Filebrowser - Expected [Mount Path] to start with [/], but got [%v]" $storage.mountPath) -}}
  23. {{- end }}
  24. {{ printf "filebrowser-%v" (int $idx) }}:
  25. enabled: true
  26. type: {{ $storage.type }}
  27. datasetName: {{ $storage.datasetName | default "" }}
  28. hostPath: {{ $storage.hostPath | default "" }}
  29. targetSelector:
  30. filebrowser:
  31. filebrowser:
  32. mountPath: /data{{ $storage.mountPath }}
  33. 01-permissions:
  34. mountPath: /mnt/directories{{ $storage.mountPath }}
  35. {{- end }}
  36. {{/* Certificate */}}
  37. {{- with .Values.filebrowserNetwork.certificateID }}
  38. cert:
  39. enabled: true
  40. type: secret
  41. objectName: filebrowser-cert
  42. defaultMode: "0600"
  43. items:
  44. - key: tls.key
  45. path: tls.key
  46. - key: tls.crt
  47. path: tls.crt
  48. targetSelector:
  49. filebrowser:
  50. filebrowser:
  51. mountPath: {{ $configBasePath }}/certs
  52. readOnly: true
  53. scaleCertificate:
  54. filebrowser-cert:
  55. enabled: true
  56. id: {{ . }}
  57. {{- end -}}
  58. {{- end -}}