_persistence.tpl 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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. {{- range $idx, $storage := .Values.n8nStorage.additionalStorages }}
  23. {{ printf "n8n-%v:" (int $idx) }}
  24. enabled: true
  25. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  26. targetSelector:
  27. n8n:
  28. n8n:
  29. mountPath: {{ $storage.mountPath }}
  30. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  31. 01-permissions:
  32. mountPath: /mnt/directories{{ $storage.mountPath }}
  33. {{- end }}
  34. {{- end }}
  35. {{- include "ix.v1.common.app.postgresPersistence"
  36. (dict "pgData" .Values.n8nStorage.pgData
  37. "pgBackup" .Values.n8nStorage.pgBackup
  38. ) | nindent 2 }}
  39. {{- if .Values.n8nNetwork.certificateID }}
  40. cert:
  41. enabled: true
  42. type: secret
  43. objectName: n8n-cert
  44. defaultMode: "0600"
  45. items:
  46. - key: tls.key
  47. path: tls.key
  48. - key: tls.crt
  49. path: tls.crt
  50. targetSelector:
  51. n8n:
  52. n8n:
  53. mountPath: /certs
  54. readOnly: true
  55. scaleCertificate:
  56. n8n-cert:
  57. enabled: true
  58. id: {{ .Values.n8nNetwork.certificateID }}
  59. {{- end }}
  60. {{- end -}}