_persistance.tpl 2.3 KB

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