_persistence.tpl 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. {{- define "syncthing.persistence" -}}
  2. persistence:
  3. home:
  4. enabled: true
  5. type: {{ .Values.syncthingStorage.home.type }}
  6. datasetName: {{ .Values.syncthingStorage.home.datasetName | default "" }}
  7. hostPath: {{ .Values.syncthingStorage.home.hostPath | default "" }}
  8. targetSelector:
  9. syncthing:
  10. syncthing:
  11. mountPath: /var/syncthing
  12. 01-certs:
  13. mountPath: /var/syncthing
  14. configure:
  15. enabled: true
  16. type: configmap
  17. objectName: syncthing-configure
  18. defaultMode: "0770"
  19. targetSelector:
  20. syncthing:
  21. syncthing:
  22. mountPath: /configure.sh
  23. subPath: configure.sh
  24. truenas-logo:
  25. enabled: true
  26. type: configmap
  27. objectName: syncthing-truenas-logo
  28. defaultMode: "0770"
  29. targetSelector:
  30. syncthing:
  31. syncthing:
  32. mountPath: /var/truenas/assets/gui/default/assets/img/logo-horizontal.svg
  33. subPath: logo-horizontal.svg
  34. {{- if not .Values.syncthingStorage.additionalStorages -}}
  35. {{- fail "Syncthing - Expected at least one additional storage defined" -}}
  36. {{- end -}}
  37. {{- range $idx, $storage := .Values.syncthingStorage.additionalStorages }}
  38. {{ printf "sync-%v" (int $idx) }}:
  39. {{- $size := "" -}}
  40. {{- if $storage.size -}}
  41. {{- $size = (printf "%vGi" $storage.size) -}}
  42. {{- end }}
  43. enabled: true
  44. type: {{ $storage.type }}
  45. datasetName: {{ $storage.datasetName | default "" }}
  46. hostPath: {{ $storage.hostPath | default "" }}
  47. server: {{ $storage.server | default "" }}
  48. share: {{ $storage.share | default "" }}
  49. domain: {{ $storage.domain | default "" }}
  50. username: {{ $storage.username | default "" }}
  51. password: {{ $storage.password | default "" }}
  52. size: {{ $size }}
  53. {{- if eq $storage.type "smb-pv-pvc" }}
  54. mountOptions:
  55. - key: noperm
  56. {{- end }}
  57. targetSelector:
  58. syncthing:
  59. syncthing:
  60. mountPath: {{ $storage.mountPath }}
  61. {{- end }}
  62. {{- if .Values.syncthingNetwork.certificateID }}
  63. certs:
  64. enabled: true
  65. type: secret
  66. objectName: syncthing-cert
  67. defaultMode: "0600"
  68. items:
  69. - key: tls.key
  70. path: https-key.pem
  71. - key: tls.crt
  72. path: https-cert.pem
  73. targetSelector:
  74. syncthing:
  75. 01-certs:
  76. mountPath: /certs
  77. readOnly: true
  78. scaleCertificate:
  79. syncthing-cert:
  80. enabled: true
  81. id: {{ .Values.syncthingNetwork.certificateID }}
  82. {{- end -}}
  83. {{- end -}}