_persistance.tpl 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {{- define "piwigo.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. {{- include "piwi.storage.ci.migration" (dict "storage" .Values.piwiStorage.config) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.piwiStorage.config) | nindent 4 }}
  7. targetSelector:
  8. piwigo:
  9. piwigo:
  10. mountPath: /config
  11. gallery:
  12. enabled: true
  13. {{- include "piwi.storage.ci.migration" (dict "storage" .Values.piwiStorage.gallery) }}
  14. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.piwiStorage.gallery) | nindent 4 }}
  15. targetSelector:
  16. piwigo:
  17. piwigo:
  18. mountPath: /gallery
  19. tmp:
  20. enabled: true
  21. type: emptyDir
  22. targetSelector:
  23. piwigo:
  24. piwigo:
  25. mountPath: /tmp
  26. {{- range $idx, $storage := .Values.piwiStorage.additionalStorages }}
  27. {{ printf "piwi-%v" (int $idx) }}:
  28. enabled: true
  29. {{- include "piwi.storage.ci.migration" (dict "storage" $storage) }}
  30. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  31. targetSelector:
  32. piwigo:
  33. piwigo:
  34. mountPath: {{ $storage.mountPath }}
  35. {{- end }}
  36. mariadbdata:
  37. enabled: true
  38. {{- include "piwi.storage.ci.migration" (dict "storage" .Values.piwiStorage.mariadbData) }}
  39. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.piwiStorage.mariadbData) | nindent 4 }}
  40. targetSelector:
  41. # MariaDB pod
  42. mariadb:
  43. # MariaDB container
  44. mariadb:
  45. mountPath: /var/lib/mysql
  46. # MariaDB - Permissions container
  47. permissions:
  48. mountPath: /mnt/directories/mariadb_data
  49. mariadbbackup:
  50. enabled: true
  51. {{- include "piwi.storage.ci.migration" (dict "storage" .Values.piwiStorage.mariadbBackup) }}
  52. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.piwiStorage.mariadbBackup) | nindent 4 }}
  53. targetSelector:
  54. # MariaDB backup pod
  55. mariadbbackup:
  56. # MariaDB backup container
  57. mariadbbackup:
  58. mountPath: /mariadb_backup
  59. # MariaDB - Permissions container
  60. permissions:
  61. mountPath: /mnt/directories/mariadb_backup
  62. {{- end -}}
  63. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  64. {{- define "piwi.storage.ci.migration" -}}
  65. {{- $storage := .storage -}}
  66. {{- if $storage.hostPath -}}
  67. {{- $_ := set $storage "hostPathConfig" dict -}}
  68. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  69. {{- end -}}
  70. {{- end -}}