_persistence.tpl 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. {{- define "immich.persistence" -}}
  2. {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.pgData) }}
  3. {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.pgBackup) }}
  4. {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.library) }}
  5. {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.uploads) }}
  6. {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.thumbs) }}
  7. {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.profile) }}
  8. {{- include "immich.storage.ci.migration" (dict "storage" .Values.immichStorage.video) }}
  9. persistence:
  10. {{/* Data */}}
  11. library:
  12. enabled: true
  13. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.library) | nindent 4 }}
  14. targetSelector:
  15. server:
  16. server:
  17. mountPath: /usr/src/app/upload/library
  18. microservices:
  19. microservices:
  20. mountPath: /usr/src/app/upload/library
  21. uploads:
  22. enabled: true
  23. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.uploads) | nindent 4 }}
  24. targetSelector:
  25. server:
  26. server:
  27. mountPath: /usr/src/app/upload/upload
  28. microservices:
  29. microservices:
  30. mountPath: /usr/src/app/upload/upload
  31. thumbs:
  32. enabled: true
  33. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.thumbs) | nindent 4 }}
  34. targetSelector:
  35. server:
  36. server:
  37. mountPath: /usr/src/app/upload/thumbs
  38. microservices:
  39. microservices:
  40. mountPath: /usr/src/app/upload/thumbs
  41. profile:
  42. enabled: true
  43. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.profile) | nindent 4 }}
  44. targetSelector:
  45. server:
  46. server:
  47. mountPath: /usr/src/app/upload/profile
  48. microservices:
  49. microservices:
  50. mountPath: /usr/src/app/upload/profile
  51. video:
  52. enabled: true
  53. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.immichStorage.video) | nindent 4 }}
  54. targetSelector:
  55. server:
  56. server:
  57. mountPath: /usr/src/app/upload/encoded-video
  58. microservices:
  59. microservices:
  60. mountPath: /usr/src/app/upload/encoded-video
  61. {{- range $idx, $storage := .Values.immichStorage.additionalStorages }}
  62. {{ printf "immich-%v:" (int $idx) }}
  63. enabled: true
  64. {{- include "immich.storage.ci.migration" (dict "storage" $storage) }}
  65. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  66. targetSelector:
  67. server:
  68. server:
  69. mountPath: {{ $storage.mountPath }}
  70. microservices:
  71. microservices:
  72. mountPath: {{ $storage.mountPath }}
  73. {{- end }}
  74. {{/* Caches */}}
  75. microcache:
  76. enabled: true
  77. type: emptyDir
  78. targetSelector:
  79. microservices:
  80. microservices:
  81. mountPath: /microcache
  82. {{- if .Values.immichConfig.enableTypesense }}
  83. typsense:
  84. enabled: true
  85. type: emptyDir
  86. targetSelector:
  87. typesense:
  88. typesense:
  89. mountPath: /typesense-data
  90. {{- end -}}
  91. {{- if .Values.immichConfig.enableML }}
  92. mlcache:
  93. enabled: true
  94. type: emptyDir
  95. targetSelector:
  96. machinelearning:
  97. machinelearning:
  98. mountPath: /mlcache
  99. {{- end }}
  100. redis:
  101. enabled: true
  102. type: emptyDir
  103. targetSelector:
  104. redis:
  105. redis:
  106. mountPath: /bitnami/redis/data
  107. tmp:
  108. enabled: true
  109. type: emptyDir
  110. targetSelector:
  111. redis:
  112. redis:
  113. mountPath: /tmp
  114. {{/* Database */}}
  115. {{- include "ix.v1.common.app.postgresPersistence"
  116. (dict "pgData" .Values.immichStorage.pgData
  117. "pgBackup" .Values.immichStorage.pgBackup
  118. ) | nindent 2 }}
  119. {{- end -}}
  120. {{/* Can be removed on the next bump (1.1.0+), only used for CI values */}}
  121. {{- define "immich.storage.ci.migration" -}}
  122. {{- $storage := .storage -}}
  123. {{- if $storage.hostPath -}}
  124. {{- $_ := set $storage "hostPathConfig" dict -}}
  125. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  126. {{- end -}}
  127. {{- end -}}