_persistence.tpl 2.2 KB

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