_persistence.tpl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. {{- define "sftpgo.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. type: {{ .Values.sftpgoStorage.config.type }}
  6. datasetName: {{ .Values.sftpgoStorage.config.datasetName | default "" }}
  7. hostPath: {{ .Values.sftpgoStorage.config.hostPath | default "" }}
  8. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.sftpgoStorage.config) | nindent 4 }}
  9. targetSelector:
  10. sftpgo:
  11. sftpgo:
  12. mountPath: /var/lib/sftpgo
  13. {{- if and (eq .Values.sftpgoStorage.config.type "ixVolume")
  14. (not (.Values.sftpgoStorage.config.ixVolumeConfig | default dict).aclEnable) }}
  15. 01-permissions:
  16. mountPath: /mnt/directories/config
  17. {{- end }}
  18. data:
  19. enabled: true
  20. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.sftpgoStorage.data) | nindent 4 }}
  21. targetSelector:
  22. sftpgo:
  23. sftpgo:
  24. mountPath: /srv/sftpgo/data
  25. {{- if and (eq .Values.sftpgoStorage.data.type "ixVolume")
  26. (not (.Values.sftpgoStorage.data.ixVolumeConfig | default dict).aclEnable) }}
  27. 01-permissions:
  28. mountPath: /mnt/directories/data
  29. {{- end }}
  30. backups:
  31. enabled: true
  32. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.sftpgoStorage.backups) | nindent 4 }}
  33. targetSelector:
  34. sftpgo:
  35. sftpgo:
  36. mountPath: /srv/sftpgo/backups
  37. {{- if and (eq .Values.sftpgoStorage.backups.type "ixVolume")
  38. (not (.Values.sftpgoStorage.backups.ixVolumeConfig | default dict).aclEnable) }}
  39. 01-permissions:
  40. mountPath: /mnt/directories/backups
  41. {{- end }}
  42. tmp:
  43. enabled: true
  44. type: emptyDir
  45. targetSelector:
  46. sftpgo:
  47. sftpgo:
  48. mountPath: /tmp
  49. {{- range $idx, $storage := .Values.sftpgoStorage.additionalStorages }}
  50. {{ printf "sftpgo-%v:" (int $idx) }}
  51. enabled: true
  52. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  53. targetSelector:
  54. sftpgo:
  55. sftpgo:
  56. mountPath: {{ $storage.mountPath }}
  57. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  58. 01-permissions:
  59. mountPath: /mnt/directories{{ $storage.mountPath }}
  60. {{- end }}
  61. {{- end -}}
  62. {{- if .Values.sftpgoNetwork.certificateID }}
  63. cert:
  64. enabled: true
  65. type: secret
  66. objectName: sftpgo-cert
  67. defaultMode: "0600"
  68. items:
  69. - key: tls.key
  70. path: private.key
  71. - key: tls.crt
  72. path: public.crt
  73. targetSelector:
  74. sftpgo:
  75. sftpgo:
  76. mountPath: /srv/sftpgo/certs
  77. readOnly: true
  78. scaleCertificate:
  79. sftpgo-cert:
  80. enabled: true
  81. id: {{ .Values.sftpgoNetwork.certificateID }}
  82. {{- end -}}
  83. {{- end -}}