_persistence.tpl 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. {{- define "upb.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. type: {{ .Values.upbStorage.config.type }}
  6. datasetName: {{ .Values.upbStorage.config.datasetName | default "" }}
  7. hostPath: {{ .Values.upbStorage.config.hostPath | default "" }}
  8. targetSelector:
  9. unifi-protect:
  10. unifi-protect:
  11. mountPath: /config
  12. 01-permissions:
  13. mountPath: /mnt/directories/config
  14. data:
  15. enabled: true
  16. type: {{ .Values.upbStorage.data.type }}
  17. datasetName: {{ .Values.upbStorage.data.datasetName | default "" }}
  18. hostPath: {{ .Values.upbStorage.data.hostPath | default "" }}
  19. targetSelector:
  20. unifi-protect:
  21. unifi-protect:
  22. mountPath: /data
  23. 01-permissions:
  24. mountPath: /mnt/directories/data
  25. tmp:
  26. enabled: true
  27. type: emptyDir
  28. targetSelector:
  29. unifi-protect:
  30. unifi-protect:
  31. mountPath: /tmp
  32. {{- range $idx, $storage := .Values.upbStorage.additionalStorages }}
  33. {{ printf "upb-%v" (int $idx) }}:
  34. {{- $size := "" -}}
  35. {{- if $storage.size -}}
  36. {{- $size = (printf "%vGi" $storage.size) -}}
  37. {{- end }}
  38. enabled: true
  39. type: {{ $storage.type }}
  40. datasetName: {{ $storage.datasetName | default "" }}
  41. hostPath: {{ $storage.hostPath | default "" }}
  42. server: {{ $storage.server | default "" }}
  43. share: {{ $storage.share | default "" }}
  44. domain: {{ $storage.domain | default "" }}
  45. username: {{ $storage.username | default "" }}
  46. password: {{ $storage.password | default "" }}
  47. size: {{ $size }}
  48. {{- if eq $storage.type "smb-pv-pvc" }}
  49. mountOptions:
  50. - key: noperm
  51. {{- end }}
  52. targetSelector:
  53. unifi-protect:
  54. unifi-protect:
  55. mountPath: {{ $storage.mountPath }}
  56. 01-permissions:
  57. mountPath: /mnt/directories{{ $storage.mountPath }}
  58. {{- end }}
  59. {{- end -}}