_persistence.tpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. {{- define "odoo.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.odooStorage.data) | nindent 4 }}
  6. targetSelector:
  7. odoo:
  8. odoo:
  9. mountPath: /var/lib/odoo
  10. 02-db-init:
  11. mountPath: /var/lib/odoo
  12. {{- if and (eq .Values.odooStorage.data.type "ixVolume")
  13. (not (.Values.odooStorage.data.ixVolumeConfig | default dict).aclEnable) }}
  14. 01-permissions:
  15. mountPath: /mnt/directories/data
  16. {{- end }}
  17. addons:
  18. enabled: true
  19. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.odooStorage.addons) | nindent 4 }}
  20. targetSelector:
  21. odoo:
  22. odoo:
  23. mountPath: /mnt/extra-addons
  24. 02-db-init:
  25. mountPath: /mnt/extra-addons
  26. {{- if and (eq .Values.odooStorage.addons.type "ixVolume")
  27. (not (.Values.odooStorage.addons.ixVolumeConfig | default dict).aclEnable) }}
  28. 01-permissions:
  29. mountPath: /mnt/directories/addons
  30. {{- end }}
  31. tmp:
  32. enabled: true
  33. type: emptyDir
  34. targetSelector:
  35. odoo:
  36. odoo:
  37. mountPath: /tmp
  38. 02-db-init:
  39. mountPath: /tmp
  40. config:
  41. enabled: true
  42. type: secret
  43. objectName: odoo-config
  44. targetSelector:
  45. odoo:
  46. odoo:
  47. mountPath: /etc/odoo/odoo.conf
  48. readOnly: true
  49. subPath: odoo.conf
  50. 02-db-init:
  51. mountPath: /etc/odoo/odoo.conf
  52. readOnly: true
  53. subPath: odoo.conf
  54. {{- range $idx, $storage := .Values.odooStorage.additionalStorages }}
  55. {{ printf "odoo-%v:" (int $idx) }}
  56. enabled: true
  57. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  58. targetSelector:
  59. odoo:
  60. odoo:
  61. mountPath: {{ $storage.mountPath }}
  62. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  63. 01-permissions:
  64. mountPath: /mnt/directories{{ $storage.mountPath }}
  65. {{- end }}
  66. {{- end }}
  67. {{- include "ix.v1.common.app.postgresPersistence"
  68. (dict "pgData" .Values.odooStorage.pgData
  69. "pgBackup" .Values.odooStorage.pgBackup
  70. ) | nindent 2 }}
  71. {{- end -}}