_persistence.tpl 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: /usr/lib/unifi/data
  12. 01-permissions:
  13. mountPath: /mnt/directories/unifi
  14. 02-migrate:
  15. mountPath: /usr/lib/unifi/data
  16. cert:
  17. # Mounted secrets are combined
  18. # into a java keystore at startup
  19. enabled: true
  20. type: emptyDir
  21. targetSelector:
  22. unifi:
  23. unifi:
  24. mountPath: /usr/lib/unifi/cert
  25. logs:
  26. enabled: true
  27. type: emptyDir
  28. targetSelector:
  29. unifi:
  30. unifi:
  31. mountPath: /usr/lib/unifi/logs
  32. tmp:
  33. enabled: true
  34. type: emptyDir
  35. targetSelector:
  36. unifi:
  37. unifi:
  38. mountPath: /tmp
  39. {{- range $idx, $storage := .Values.unifiStorage.additionalStorages }}
  40. {{ printf "unifi-%v" (int $idx) }}:
  41. {{- $size := "" -}}
  42. {{- if $storage.size -}}
  43. {{- $size = (printf "%vGi" $storage.size) -}}
  44. {{- end }}
  45. enabled: true
  46. type: {{ $storage.type }}
  47. datasetName: {{ $storage.datasetName | default "" }}
  48. hostPath: {{ $storage.hostPath | default "" }}
  49. server: {{ $storage.server | default "" }}
  50. share: {{ $storage.share | default "" }}
  51. domain: {{ $storage.domain | default "" }}
  52. username: {{ $storage.username | default "" }}
  53. password: {{ $storage.password | default "" }}
  54. size: {{ $size }}
  55. {{- if eq $storage.type "smb-pv-pvc" }}
  56. mountOptions:
  57. - key: noperm
  58. {{- end }}
  59. targetSelector:
  60. unifi:
  61. unifi:
  62. mountPath: {{ $storage.mountPath }}
  63. 01-permissions:
  64. mountPath: /mnt/directories{{ $storage.mountPath }}
  65. {{- end -}}
  66. {{- if .Values.unifiNetwork.certificateID }}
  67. cert-private:
  68. enabled: true
  69. type: secret
  70. objectName: unifi-cert
  71. defaultMode: "0600"
  72. targetSelector:
  73. unifi:
  74. unifi:
  75. mountPath: /usr/lib/unifi/cert/privkey.pem
  76. subPath: tls.key
  77. readOnly: true
  78. cert-public:
  79. enabled: true
  80. type: secret
  81. objectName: unifi-cert
  82. defaultMode: "0600"
  83. targetSelector:
  84. unifi:
  85. unifi:
  86. mountPath: /usr/lib/unifi/cert/cert.pem
  87. subPath: tls.crt
  88. readOnly: true
  89. scaleCertificate:
  90. unifi-cert:
  91. enabled: true
  92. id: {{ .Values.unifiNetwork.certificateID }}
  93. {{- end -}}
  94. {{- end -}}