_syncthing.tpl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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. - SYS_ADMIN
  34. env:
  35. PCAP: cap_sys_admin,cap_chown,cap_dac_override,cap_fowner+ep
  36. STGUIADDRESS: "0.0.0.0:{{ .Values.syncthingNetwork.webPort }}"
  37. # Set a custom override for the GUI assets
  38. STGUIASSETS: /var/truenas/assets/gui
  39. # Disable automatic upgrades
  40. STNOUPGRADE: "true"
  41. fixedEnv:
  42. PUID: {{ .Values.syncthingID.user }}
  43. probes:
  44. liveness:
  45. enabled: true
  46. type: http
  47. path: /rest/noauth/health
  48. port: "{{ .Values.syncthingNetwork.webPort }}"
  49. readiness:
  50. enabled: true
  51. type: http
  52. path: /rest/noauth/health
  53. port: "{{ .Values.syncthingNetwork.webPort }}"
  54. startup:
  55. enabled: true
  56. type: http
  57. path: /rest/noauth/health
  58. port: "{{ .Values.syncthingNetwork.webPort }}"
  59. # We use this hook as we need the API
  60. # to be running when we run the configure script
  61. lifecycle:
  62. postStart:
  63. type: exec
  64. command:
  65. - su-exec
  66. - "{{ .Values.syncthingID.user }}:{{ .Values.syncthingID.group }}"
  67. - /configure.sh
  68. {{- if .Values.syncthingNetwork.certificateID }}
  69. initContainers:
  70. {{- include "syncthing.certContainer" $ | nindent 8 -}}
  71. {{- end }}
  72. {{- end -}}