_persistence.tpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. {{- define "unifi.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.unifiStorage.data) | nindent 4 }}
  6. targetSelector:
  7. unifi:
  8. unifi:
  9. mountPath: /usr/lib/unifi/data
  10. {{- if and (eq .Values.unifiStorage.data.type "ixVolume")
  11. (not (.Values.unifiStorage.data.ixVolumeConfig | default dict).aclEnable) }}
  12. 01-permissions:
  13. mountPath: /mnt/directories/unifi
  14. {{- end }}
  15. 02-migrate:
  16. mountPath: /usr/lib/unifi/data
  17. cert:
  18. # Mounted secrets are combined
  19. # into a java keystore at startup
  20. enabled: true
  21. type: emptyDir
  22. targetSelector:
  23. unifi:
  24. unifi:
  25. mountPath: /usr/lib/unifi/cert
  26. logs:
  27. enabled: true
  28. type: emptyDir
  29. targetSelector:
  30. unifi:
  31. unifi:
  32. mountPath: /usr/lib/unifi/logs
  33. tmp:
  34. enabled: true
  35. type: emptyDir
  36. targetSelector:
  37. unifi:
  38. unifi:
  39. mountPath: /tmp
  40. {{- range $idx, $storage := .Values.unifiStorage.additionalStorages }}
  41. {{ printf "unifi-%v" (int $idx) }}:
  42. enabled: true
  43. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  44. targetSelector:
  45. unifi:
  46. unifi:
  47. mountPath: {{ $storage.mountPath }}
  48. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  49. 01-permissions:
  50. mountPath: /mnt/directories{{ $storage.mountPath }}
  51. {{- end }}
  52. {{- end -}}
  53. {{- if .Values.unifiNetwork.certificateID }}
  54. cert-private:
  55. enabled: true
  56. type: secret
  57. objectName: unifi-cert
  58. defaultMode: "0600"
  59. targetSelector:
  60. unifi:
  61. unifi:
  62. mountPath: /usr/lib/unifi/cert/privkey.pem
  63. subPath: tls.key
  64. readOnly: true
  65. cert-public:
  66. enabled: true
  67. type: secret
  68. objectName: unifi-cert
  69. defaultMode: "0600"
  70. targetSelector:
  71. unifi:
  72. unifi:
  73. mountPath: /usr/lib/unifi/cert/cert.pem
  74. subPath: tls.crt
  75. readOnly: true
  76. scaleCertificate:
  77. unifi-cert:
  78. enabled: true
  79. id: {{ .Values.unifiNetwork.certificateID }}
  80. {{- end -}}
  81. {{- end -}}