_syncthing.tpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. {{- define "syncthing.workload" -}}
  2. workload:
  3. syncthing:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.syncthingNetwork.hostNetwork }}
  9. securityContext:
  10. fsGroup: {{ .Values.syncthingID.group }}
  11. containers:
  12. syncthing:
  13. enabled: true
  14. primary: true
  15. imageSelector: image
  16. securityContext:
  17. runAsUser: 0
  18. runAsGroup: 0
  19. runAsNonRoot: false
  20. readOnlyRootFilesystem: false
  21. # This is needed to allow syncthing assign
  22. # PCAPs to its child processes
  23. allowPrivilegeEscalation: true
  24. capabilities:
  25. add:
  26. - FOWNER
  27. - DAC_OVERRIDE
  28. - CHOWN
  29. - SETUID
  30. - SETGID
  31. - SETFCAP
  32. - SETPCAP
  33. env:
  34. PCAP: cap_chown,cap_dac_override,cap_fowner+ep
  35. STGUIADDRESS: "0.0.0.0:{{ .Values.syncthingNetwork.webPort }}"
  36. # Set a custom override for the GUI assets
  37. STGUIASSETS: /var/truenas/assets/gui
  38. # Disable automatic upgrades
  39. STNOUPGRADE: "true"
  40. fixedEnv:
  41. PUID: {{ .Values.syncthingID.user }}
  42. probes:
  43. liveness:
  44. enabled: true
  45. type: http
  46. path: /rest/noauth/health
  47. port: "{{ .Values.syncthingNetwork.webPort }}"
  48. readiness:
  49. enabled: true
  50. type: http
  51. path: /rest/noauth/health
  52. port: "{{ .Values.syncthingNetwork.webPort }}"
  53. startup:
  54. enabled: true
  55. type: http
  56. path: /rest/noauth/health
  57. port: "{{ .Values.syncthingNetwork.webPort }}"
  58. # We use this hook as we need the API
  59. # to be running when we run the configure script
  60. lifecycle:
  61. postStart:
  62. type: exec
  63. command:
  64. - su-exec
  65. - "{{ .Values.syncthingID.user }}:{{ .Values.syncthingID.group }}"
  66. - /configure.sh
  67. {{- if .Values.syncthingNetwork.certificateID }}
  68. initContainers:
  69. {{- include "syncthing.certContainer" $ | nindent 8 -}}
  70. {{- end }}
  71. {{- end -}}