_persistence.tpl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. enabled: true
  40. type: {{ $storage.type }}
  41. datasetName: {{ $storage.datasetName | default "" }}
  42. hostPath: {{ $storage.hostPath | default "" }}
  43. targetSelector:
  44. syncthing:
  45. syncthing:
  46. mountPath: {{ $storage.mountPath }}
  47. {{- end }}
  48. {{- if .Values.syncthingNetwork.certificateID }}
  49. certs:
  50. enabled: true
  51. type: secret
  52. objectName: syncthing-cert
  53. defaultMode: "0600"
  54. items:
  55. - key: tls.key
  56. path: https-key.pem
  57. - key: tls.crt
  58. path: https-cert.pem
  59. targetSelector:
  60. syncthing:
  61. 01-certs:
  62. mountPath: /certs
  63. readOnly: true
  64. scaleCertificate:
  65. syncthing-cert:
  66. enabled: true
  67. id: {{ .Values.syncthingNetwork.certificateID }}
  68. {{- end -}}
  69. {{- end -}}