_persistence.tpl 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {{- define "kapowarr.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. {{- include "kapowarr.storage.ci.migration" (dict "storage" .Values.kapowarrStorage.config) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.kapowarrStorage.config) | nindent 4 }}
  7. targetSelector:
  8. kapowarr:
  9. kapowarr:
  10. mountPath: /app/db
  11. {{- if and (eq .Values.kapowarrStorage.config.type "ixVolume")
  12. (not (.Values.kapowarrStorage.config.ixVolumeConfig | default dict).aclEnable) }}
  13. 01-permissions:
  14. mountPath: /mnt/directories/config
  15. {{- end }}
  16. downloads:
  17. enabled: true
  18. {{- include "kapowarr.storage.ci.migration" (dict "storage" .Values.kapowarrStorage.downloads) }}
  19. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.kapowarrStorage.downloads) | nindent 4 }}
  20. targetSelector:
  21. kapowarr:
  22. kapowarr:
  23. mountPath: /app/temp_downloads
  24. {{- if and (eq .Values.kapowarrStorage.downloads.type "ixVolume")
  25. (not (.Values.kapowarrStorage.downloads.ixVolumeConfig | default dict).aclEnable) }}
  26. 01-permissions:
  27. mountPath: /mnt/directories/downloads
  28. {{- end }}
  29. content:
  30. enabled: true
  31. {{- include "kapowarr.storage.ci.migration" (dict "storage" .Values.kapowarrStorage.content) }}
  32. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.kapowarrStorage.content) | nindent 4 }}
  33. targetSelector:
  34. kapowarr:
  35. kapowarr:
  36. mountPath: /content
  37. {{- if and (eq .Values.kapowarrStorage.content.type "ixVolume")
  38. (not (.Values.kapowarrStorage.content.ixVolumeConfig | default dict).aclEnable) }}
  39. 01-permissions:
  40. mountPath: /mnt/directories/content
  41. {{- end }}
  42. {{- range $idx, $storage := .Values.kapowarrStorage.additionalStorages }}
  43. {{ printf "kapowarr-%v:" (int $idx) }}
  44. enabled: true
  45. {{- include "kapowarr.storage.ci.migration" (dict "storage" $storage) }}
  46. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  47. targetSelector:
  48. kapowarr:
  49. kapowarr:
  50. mountPath: {{ $storage.mountPath }}
  51. 01-permissions:
  52. mountPath: /mnt/directories{{ $storage.mountPath }}
  53. {{- end }}
  54. {{- end -}}
  55. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  56. {{- define "kapowarr.storage.ci.migration" -}}
  57. {{- $storage := .storage -}}
  58. {{- if $storage.hostPath -}}
  59. {{- $_ := set $storage "hostPathConfig" dict -}}
  60. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  61. {{- end -}}
  62. {{- end -}}