_persistence.tpl 2.0 KB

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