_persistence.tpl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. # Postgres
  49. postgresdata:
  50. enabled: true
  51. type: {{ .Values.n8nStorage.pgData.type }}
  52. datasetName: {{ .Values.n8nStorage.pgData.datasetName | default "" }}
  53. hostPath: {{ .Values.n8nStorage.pgData.hostPath | default "" }}
  54. targetSelector:
  55. # Postgres pod
  56. postgres:
  57. # Postgres container
  58. postgres:
  59. mountPath: /var/lib/postgresql/data
  60. # Permissions container
  61. permissions:
  62. mountPath: /mnt/directories/postgres_data
  63. # Postgres backup
  64. postgresbackup:
  65. enabled: true
  66. type: {{ .Values.n8nStorage.pgBackup.type }}
  67. datasetName: {{ .Values.n8nStorage.pgBackup.datasetName | default "" }}
  68. hostPath: {{ .Values.n8nStorage.pgBackup.hostPath | default "" }}
  69. targetSelector:
  70. # Postgres backup pod
  71. postgresbackup:
  72. # Postgres backup container
  73. postgresbackup:
  74. mountPath: /postgres_backup
  75. # Permissions container
  76. permissions:
  77. mountPath: /mnt/directories/postgres_backup
  78. {{- if .Values.n8nNetwork.certificateID }}
  79. cert:
  80. enabled: true
  81. type: secret
  82. objectName: n8n-cert
  83. defaultMode: "0600"
  84. items:
  85. - key: tls.key
  86. path: tls.key
  87. - key: tls.crt
  88. path: tls.crt
  89. targetSelector:
  90. n8n:
  91. n8n:
  92. mountPath: /certs
  93. readOnly: true
  94. scaleCertificate:
  95. n8n-cert:
  96. enabled: true
  97. id: {{ .Values.n8nNetwork.certificateID }}
  98. {{- end }}
  99. {{- end -}}