_persistence.tpl 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {{- define "unifi.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. type: {{ .Values.unifiStorage.data.type }}
  6. datasetName: {{ .Values.unifiStorage.data.datasetName | default "" }}
  7. hostPath: {{ .Values.unifiStorage.data.hostPath | default "" }}
  8. targetSelector:
  9. unifi:
  10. unifi:
  11. mountPath: /unifi
  12. 01-permissions:
  13. mountPath: /mnt/directories/unifi
  14. 02-certs:
  15. mountPath: /unifi
  16. tmp:
  17. enabled: true
  18. type: emptyDir
  19. targetSelector:
  20. unifi:
  21. unifi:
  22. mountPath: /tmp
  23. {{- range $idx, $storage := .Values.unifiStorage.additionalStorages }}
  24. {{ printf "unifi-%v" (int $idx) }}:
  25. {{- $size := "" -}}
  26. {{- if $storage.size -}}
  27. {{- $size = (printf "%vGi" $storage.size) -}}
  28. {{- end }}
  29. enabled: true
  30. type: {{ $storage.type }}
  31. datasetName: {{ $storage.datasetName | default "" }}
  32. hostPath: {{ $storage.hostPath | default "" }}
  33. server: {{ $storage.server | default "" }}
  34. share: {{ $storage.share | default "" }}
  35. domain: {{ $storage.domain | default "" }}
  36. username: {{ $storage.username | default "" }}
  37. password: {{ $storage.password | default "" }}
  38. size: {{ $size }}
  39. {{- if eq $storage.type "smb-pv-pvc" }}
  40. mountOptions:
  41. - key: noperm
  42. {{- end }}
  43. targetSelector:
  44. unifi:
  45. unifi:
  46. mountPath: {{ $storage.mountPath }}
  47. 01-permissions:
  48. mountPath: /mnt/directories{{ $storage.mountPath }}
  49. {{- end -}}
  50. {{- if .Values.unifiNetwork.certificateID }}
  51. cert:
  52. enabled: true
  53. type: secret
  54. objectName: unifi-cert
  55. defaultMode: "0600"
  56. items:
  57. - key: tls.key
  58. path: private.key
  59. - key: tls.crt
  60. path: public.crt
  61. targetSelector:
  62. unifi:
  63. 02-certs:
  64. mountPath: /ix/cert
  65. readOnly: true
  66. scaleCertificate:
  67. unifi-cert:
  68. enabled: true
  69. id: {{ .Values.unifiNetwork.certificateID }}
  70. {{- end -}}
  71. {{- end -}}