_rsync.tpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. {{- define "rsync.workload" -}}
  2. workload:
  3. rsync:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.rsyncNetwork.hostNetwork }}
  9. containers:
  10. rsync:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: 0
  16. runAsGroup: 0
  17. runAsNonRoot: false
  18. readOnlyRootFilesystem: false
  19. capabilities:
  20. add:
  21. - CHOWN
  22. - DAC_OVERRIDE
  23. - FOWNER
  24. - SETGID
  25. - SETUID
  26. - SYS_CHROOT
  27. probes:
  28. liveness:
  29. enabled: true
  30. type: exec
  31. command:
  32. - /bin/sh
  33. - -c
  34. - |
  35. pgrep rsync
  36. readiness:
  37. enabled: true
  38. type: exec
  39. command:
  40. - /bin/sh
  41. - -c
  42. - |
  43. pgrep rsync
  44. startup:
  45. enabled: true
  46. type: exec
  47. command:
  48. - /bin/sh
  49. - -c
  50. - |
  51. pgrep rsync
  52. {{/* Service */}}
  53. service:
  54. rsync:
  55. enabled: true
  56. primary: true
  57. type: NodePort
  58. targetSelector: rsync
  59. ports:
  60. rsync:
  61. enabled: true
  62. primary: true
  63. port: {{ .Values.rsyncNetwork.rsyncPort }}
  64. nodePort: {{ .Values.rsyncNetwork.rsyncPort }}
  65. targetSelector: rsync
  66. {{/* Persistence */}}
  67. persistence:
  68. temp:
  69. enabled: true
  70. type: emptyDir
  71. targetSelector:
  72. rsync:
  73. rsync:
  74. mountPath: /tmp
  75. rsync-conf:
  76. enabled: true
  77. type: configmap
  78. objectName: config
  79. targetSelector:
  80. rsync:
  81. rsync:
  82. mountPath: /etc/rsyncd.conf
  83. subPath: rsyncd.conf
  84. readOnly: true
  85. {{- range $idx, $mod := .Values.rsyncModules }}
  86. {{ printf "rsyncd-%v" (int $idx) }}:
  87. enabled: {{ $mod.enabled }}
  88. type: hostPath
  89. hostPath: {{ $mod.hostPath | default "" }}
  90. targetSelector:
  91. rsync:
  92. rsync:
  93. mountPath: {{ printf "/data/%v" $mod.name }}
  94. {{- end }}
  95. {{- end -}}