_persistence.tpl 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {{- define "n8n.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.n8nStorage.data) | nindent 4 }}
  6. targetSelector:
  7. n8n:
  8. n8n:
  9. mountPath: /data
  10. {{- if and (eq .Values.n8nStorage.data.type "ixVolume")
  11. (not (.Values.n8nStorage.data.ixVolumeConfig | default dict).aclEnable) }}
  12. 01-permissions:
  13. mountPath: /mnt/directories/data
  14. {{- end }}
  15. tmp:
  16. enabled: true
  17. type: emptyDir
  18. targetSelector:
  19. n8n:
  20. n8n:
  21. mountPath: /tmp
  22. cache:
  23. enabled: true
  24. type: emptyDir
  25. targetSelector:
  26. n8n:
  27. n8n:
  28. mountPath: /.cache
  29. {{- range $idx, $storage := .Values.n8nStorage.additionalStorages }}
  30. {{ printf "n8n-%v:" (int $idx) }}
  31. enabled: true
  32. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  33. targetSelector:
  34. n8n:
  35. n8n:
  36. mountPath: {{ $storage.mountPath }}
  37. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  38. 01-permissions:
  39. mountPath: /mnt/directories{{ $storage.mountPath }}
  40. {{- end }}
  41. {{- end }}
  42. {{- include "ix.v1.common.app.postgresPersistence"
  43. (dict "pgData" .Values.n8nStorage.pgData
  44. "pgBackup" .Values.n8nStorage.pgBackup
  45. ) | nindent 2 }}
  46. {{- if .Values.n8nNetwork.certificateID }}
  47. cert:
  48. enabled: true
  49. type: secret
  50. objectName: n8n-cert
  51. defaultMode: "0600"
  52. items:
  53. - key: tls.key
  54. path: tls.key
  55. - key: tls.crt
  56. path: tls.crt
  57. targetSelector:
  58. n8n:
  59. n8n:
  60. mountPath: /certs
  61. readOnly: true
  62. scaleCertificate:
  63. n8n-cert:
  64. enabled: true
  65. id: {{ .Values.n8nNetwork.certificateID }}
  66. {{- end }}
  67. {{- end -}}