_persistence.tpl 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. enabled: true
  24. type: {{ $storage.type }}
  25. datasetName: {{ $storage.datasetName | default "" }}
  26. hostPath: {{ $storage.hostPath | default "" }}
  27. targetSelector:
  28. n8n:
  29. n8n:
  30. mountPath: {{ $storage.mountPath }}
  31. 01-permissions:
  32. mountPath: /mnt/directories{{ $storage.mountPath }}
  33. {{- end }}
  34. # Postgres
  35. postgresdata:
  36. enabled: true
  37. type: {{ .Values.n8nStorage.pgData.type }}
  38. datasetName: {{ .Values.n8nStorage.pgData.datasetName | default "" }}
  39. hostPath: {{ .Values.n8nStorage.pgData.hostPath | default "" }}
  40. targetSelector:
  41. # Postgres pod
  42. postgres:
  43. # Postgres container
  44. postgres:
  45. mountPath: /var/lib/postgresql/data
  46. # Permissions container
  47. permissions:
  48. mountPath: /mnt/directories/postgres_data
  49. # Postgres backup
  50. postgresbackup:
  51. enabled: true
  52. type: {{ .Values.n8nStorage.pgBackup.type }}
  53. datasetName: {{ .Values.n8nStorage.pgBackup.datasetName | default "" }}
  54. hostPath: {{ .Values.n8nStorage.pgBackup.hostPath | default "" }}
  55. targetSelector:
  56. # Postgres backup pod
  57. postgresbackup:
  58. # Postgres backup container
  59. postgresbackup:
  60. mountPath: /postgres_backup
  61. # Permissions container
  62. permissions:
  63. mountPath: /mnt/directories/postgres_backup
  64. {{- if .Values.n8nNetwork.certificateID }}
  65. cert:
  66. enabled: true
  67. type: secret
  68. objectName: n8n-cert
  69. defaultMode: "0600"
  70. items:
  71. - key: tls.key
  72. path: tls.key
  73. - key: tls.crt
  74. path: tls.crt
  75. targetSelector:
  76. n8n:
  77. n8n:
  78. mountPath: /certs
  79. readOnly: true
  80. scaleCertificate:
  81. n8n-cert:
  82. enabled: true
  83. id: {{ .Values.n8nNetwork.certificateID }}
  84. {{- end }}
  85. {{- end -}}