_persistence.tpl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. {{- define "linkding.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. {{- include "linkding.storage.ci.migration" (dict "storage" .Values.linkdingStorage.data) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.linkdingStorage.data) | nindent 4 }}
  7. targetSelector:
  8. linkding:
  9. linkding:
  10. mountPath: /etc/linkding/data
  11. secret:
  12. enabled: true
  13. type: secret
  14. objectName: linkding-secret
  15. defaultMode: "0600"
  16. targetSelector:
  17. linkding:
  18. linkding:
  19. mountPath: /etc/linkding/secretkey.txt
  20. subPath: secretkey.txt
  21. tmp:
  22. enabled: true
  23. type: emptyDir
  24. targetSelector:
  25. linkding:
  26. linkding:
  27. mountPath: /tmp
  28. {{- range $idx, $storage := .Values.linkdingStorage.additionalStorages }}
  29. {{ printf "linkding-%v:" (int $idx) }}
  30. enabled: true
  31. {{- include "linkding.storage.ci.migration" (dict "storage" $storage) }}
  32. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  33. targetSelector:
  34. linkding:
  35. linkding:
  36. mountPath: {{ $storage.mountPath }}
  37. {{- end }}
  38. {{- include "linkding.storage.ci.migration" (dict "storage" .Values.linkdingStorage.pgData) }}
  39. {{- include "linkding.storage.ci.migration" (dict "storage" .Values.linkdingStorage.pgBackup) }}
  40. {{- include "ix.v1.common.app.postgresPersistence"
  41. (dict "pgData" .Values.linkdingStorage.pgData
  42. "pgBackup" .Values.linkdingStorage.pgBackup
  43. ) | nindent 2 }}
  44. {{- end -}}
  45. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  46. {{- define "linkding.storage.ci.migration" -}}
  47. {{- $storage := .storage -}}
  48. {{- if $storage.hostPath -}}
  49. {{- $_ := set $storage "hostPathConfig" dict -}}
  50. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  51. {{- end -}}
  52. {{- end -}}