_persistence.tpl 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. username: {{ $storage.username | default "" }}
  50. password: {{ $storage.password | default "" }}
  51. size: {{ $size }}
  52. {{- with $storage.mountOptions }}
  53. mountOptions:
  54. {{- range $opt := . }}
  55. - key: {{ $opt.key | default "" }}
  56. value: {{ $opt.value | default "" }}
  57. {{- end }}
  58. {{- end }}
  59. targetSelector:
  60. syncthing:
  61. syncthing:
  62. mountPath: {{ $storage.mountPath }}
  63. {{- end }}
  64. {{- if .Values.syncthingNetwork.certificateID }}
  65. certs:
  66. enabled: true
  67. type: secret
  68. objectName: syncthing-cert
  69. defaultMode: "0600"
  70. items:
  71. - key: tls.key
  72. path: https-key.pem
  73. - key: tls.crt
  74. path: https-cert.pem
  75. targetSelector:
  76. syncthing:
  77. 01-certs:
  78. mountPath: /certs
  79. readOnly: true
  80. scaleCertificate:
  81. syncthing-cert:
  82. enabled: true
  83. id: {{ .Values.syncthingNetwork.certificateID }}
  84. {{- end -}}
  85. {{- end -}}