_persistence.tpl 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. {{- define "nextcloud.persistence" -}}
  2. persistence:
  3. html:
  4. enabled: true
  5. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  6. targetSelector:
  7. nextcloud:
  8. nextcloud:
  9. mountPath: /var/www/html
  10. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  11. subPath: html
  12. {{- end }}
  13. nextcloud-cron:
  14. nextcloud-cron:
  15. mountPath: /var/www/html
  16. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  17. subPath: html
  18. {{- end }}
  19. postgresbackup:
  20. postgresbackup:
  21. mountPath: /nc-config
  22. data:
  23. enabled: true
  24. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.data) | nindent 4 }}
  25. targetSelector:
  26. nextcloud:
  27. nextcloud:
  28. mountPath: {{ .Values.ncConfig.dataDir }}
  29. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  30. subPath: data
  31. {{- end }}
  32. nextcloud-cron:
  33. nextcloud-cron:
  34. mountPath: {{ .Values.ncConfig.dataDir }}
  35. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  36. subPath: data
  37. {{- end }}
  38. {{- if .Values.ncStorage.isDataInTheSameVolume }}
  39. config:
  40. enabled: true
  41. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  42. targetSelector:
  43. nextcloud:
  44. nextcloud:
  45. mountPath: /var/www/html/config
  46. subPath: config
  47. nextcloud-cron:
  48. nextcloud-cron:
  49. mountPath: /var/www/html/config
  50. subPath: config
  51. customapps:
  52. enabled: true
  53. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  54. targetSelector:
  55. nextcloud:
  56. nextcloud:
  57. mountPath: /var/www/html/custom_apps
  58. subPath: custom_apps
  59. nextcloud-cron:
  60. nextcloud-cron:
  61. mountPath: /var/www/html/custom_apps
  62. subPath: custom_apps
  63. themes:
  64. enabled: true
  65. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.ncStorage.html) | nindent 4 }}
  66. targetSelector:
  67. nextcloud:
  68. nextcloud:
  69. mountPath: /var/www/html/themes
  70. subPath: themes
  71. nextcloud-cron:
  72. nextcloud-cron:
  73. mountPath: /var/www/html/themes
  74. subPath: themes
  75. {{- end }}
  76. redis-tmp:
  77. enabled: true
  78. type: emptyDir
  79. targetSelector:
  80. redis:
  81. redis:
  82. mountPath: /tmp
  83. redis-bitnami-tmp:
  84. enabled: true
  85. type: emptyDir
  86. targetSelector:
  87. redis:
  88. redis:
  89. mountPath: /opt/bitnami/redis/tmp
  90. # Configuration files mounting
  91. nc-config-opcache:
  92. enabled: true
  93. type: configmap
  94. objectName: nextcloud-config
  95. defaultMode: "0755"
  96. targetSelector:
  97. nextcloud:
  98. nextcloud:
  99. # z-99 is used to ensure that this file is loaded last
  100. mountPath: /usr/local/etc/php/conf.d/opcache-z-99.ini
  101. subPath: opcache.ini
  102. nc-config-php:
  103. enabled: true
  104. type: configmap
  105. objectName: nextcloud-config
  106. defaultMode: "0755"
  107. targetSelector:
  108. nextcloud:
  109. nextcloud:
  110. # z-99 is used to ensure that this file is loaded last
  111. mountPath: /usr/local/etc/php/conf.d/nextcloud-z-99.ini
  112. subPath: php.ini
  113. nc-config-limreqbody:
  114. enabled: true
  115. type: configmap
  116. objectName: nextcloud-config
  117. defaultMode: "0755"
  118. targetSelector:
  119. nextcloud:
  120. nextcloud:
  121. # https://github.com/nextcloud/docker/issues/1796
  122. mountPath: /etc/apache2/conf-enabled/limitrequestbody.conf
  123. subPath: limitrequestbody.conf
  124. nc-occ:
  125. enabled: true
  126. type: configmap
  127. objectName: nextcloud-config
  128. defaultMode: "0755"
  129. targetSelector:
  130. nextcloud:
  131. nextcloud:
  132. mountPath: /usr/bin/occ
  133. subPath: occ
  134. tmp:
  135. enabled: true
  136. type: emptyDir
  137. targetSelector:
  138. nextcloud:
  139. nextcloud:
  140. mountPath: /tmp
  141. {{- range $idx, $storage := .Values.ncStorage.additionalStorages }}
  142. {{ printf "nc-%v:" (int $idx) }}
  143. enabled: true
  144. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  145. targetSelector:
  146. nextcloud:
  147. nextcloud:
  148. mountPath: {{ $storage.mountPath }}
  149. nextcloud-cron:
  150. nextcloud-cron:
  151. mountPath: {{ $storage.mountPath }}
  152. {{- end }}
  153. {{- if .Values.ncNetwork.certificateID }}
  154. nginx-cert:
  155. enabled: true
  156. type: secret
  157. objectName: nextcloud-cert
  158. defaultMode: "0600"
  159. items:
  160. - key: tls.key
  161. path: private.key
  162. - key: tls.crt
  163. path: public.crt
  164. targetSelector:
  165. nginx:
  166. nginx:
  167. mountPath: /etc/nginx-certs
  168. readOnly: true
  169. nginx-conf:
  170. enabled: true
  171. type: configmap
  172. objectName: nginx
  173. defaultMode: "0600"
  174. items:
  175. - key: nginx.conf
  176. path: nginx.conf
  177. targetSelector:
  178. nginx:
  179. nginx:
  180. mountPath: /etc/nginx
  181. readOnly: true
  182. {{- end -}}
  183. {{- include "ix.v1.common.app.postgresPersistence"
  184. (dict "pgData" .Values.ncStorage.pgData
  185. "pgBackup" .Values.ncStorage.pgBackup
  186. ) | nindent 2 }}
  187. {{- end -}}
  188. {{- define "isOldIxVol" -}}
  189. {{- $oldDatasetName := "ix-nextcloud_data" -}}
  190. {{- $isOld := "false" -}}
  191. {{- $storage := .storage -}}
  192. {{- if eq $storage.type "ixVolume" -}}
  193. {{- if eq $storage.ixVolumeConfig.datasetName $oldDatasetName -}}
  194. {{- $isOld = "true" -}}
  195. {{- end -}}
  196. {{- end -}}
  197. {{- $isOld }}
  198. {{- end -}}