_tdarr.tpl 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. {{- define "tdarr.workload" -}}
  2. workload:
  3. tdarr:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: false
  9. securityContext:
  10. fsGroup: {{ .Values.tdarrID.group }}
  11. containers:
  12. tdarr:
  13. enabled: true
  14. primary: true
  15. imageSelector: image
  16. securityContext:
  17. runAsUser: 0
  18. runAsGroup: 0
  19. readOnlyRootFilesystem: false
  20. runAsNonRoot: false
  21. capabilities:
  22. add:
  23. - CHOWN
  24. - FOWNER
  25. - SETUID
  26. - SETGID
  27. env:
  28. inContainer: "true"
  29. internalNode: {{ .Values.tdarrConfig.internalNode | quote }}
  30. serverPort: {{ .Values.tdarrNetwork.serverPort }}
  31. webUIPort: {{ .Values.tdarrNetwork.webPort }}
  32. nodeName: {{ .Values.tdarrConfig.nodeName }}
  33. serverIP: {{ .Values.tdarrConfig.serverIP }}
  34. fixedEnv:
  35. PUID: {{ .Values.tdarrID.user }}
  36. {{ with .Values.tdarrConfig.additionalEnvs }}
  37. envList:
  38. {{ range $env := . }}
  39. - name: {{ $env.name }}
  40. value: {{ $env.value }}
  41. {{ end }}
  42. {{ end }}
  43. probes:
  44. liveness:
  45. enabled: true
  46. type: http
  47. port: "{{ .Values.tdarrNetwork.webPort }}"
  48. path: /api/v2/status
  49. readiness:
  50. enabled: true
  51. type: http
  52. port: "{{ .Values.tdarrNetwork.webPort }}"
  53. path: /api/v2/status
  54. startup:
  55. enabled: true
  56. type: http
  57. port: "{{ .Values.tdarrNetwork.webPort }}"
  58. path: /api/v2/status
  59. {{/* Service */}}
  60. service:
  61. tdarr:
  62. enabled: true
  63. primary: true
  64. type: NodePort
  65. targetSelector: tdarr
  66. ports:
  67. webui:
  68. enabled: true
  69. primary: true
  70. port: {{ .Values.tdarrNetwork.webPort }}
  71. nodePort: {{ .Values.tdarrNetwork.webPort }}
  72. targetSelector: tdarr
  73. server:
  74. enabled: true
  75. port: {{ .Values.tdarrNetwork.serverPort }}
  76. nodePort: {{ .Values.tdarrNetwork.serverPort }}
  77. targetSelector: tdarr
  78. {{/* Persistence */}}
  79. persistence:
  80. server:
  81. enabled: true
  82. type: {{ .Values.tdarrStorage.server.type }}
  83. datasetName: {{ .Values.tdarrStorage.server.datasetName | default "" }}
  84. hostPath: {{ .Values.tdarrStorage.server.hostPath | default "" }}
  85. targetSelector:
  86. tdarr:
  87. tdarr:
  88. mountPath: /app/server
  89. configs:
  90. enabled: true
  91. type: {{ .Values.tdarrStorage.configs.type }}
  92. datasetName: {{ .Values.tdarrStorage.configs.datasetName | default "" }}
  93. hostPath: {{ .Values.tdarrStorage.configs.hostPath | default "" }}
  94. targetSelector:
  95. tdarr:
  96. tdarr:
  97. mountPath: /app/configs
  98. logs:
  99. enabled: true
  100. type: {{ .Values.tdarrStorage.logs.type }}
  101. datasetName: {{ .Values.tdarrStorage.logs.datasetName | default "" }}
  102. hostPath: {{ .Values.tdarrStorage.logs.hostPath | default "" }}
  103. targetSelector:
  104. tdarr:
  105. tdarr:
  106. mountPath: /app/logs
  107. transcode:
  108. enabled: true
  109. type: {{ .Values.tdarrStorage.transcodes.type }}
  110. datasetName: {{ .Values.tdarrStorage.transcodes.datasetName | default "" }}
  111. hostPath: {{ .Values.tdarrStorage.transcodes.hostPath | default "" }}
  112. medium: {{ .Values.tdarrStorage.transcodes.medium | default "" }}
  113. {{/* Size of the emptyDir */}}
  114. size: {{ .Values.tdarrStorage.transcodes.size | default "" }}
  115. targetSelector:
  116. tdarr:
  117. tdarr:
  118. mountPath: /temp
  119. {{- range $idx, $storage := .Values.tdarrStorage.additionalStorages }}
  120. {{ printf "tdarr-%v" (int $idx) }}:
  121. {{- $size := "" -}}
  122. {{- if $storage.size -}}
  123. {{- $size = (printf "%vGi" $storage.size) -}}
  124. {{- end }}
  125. enabled: true
  126. type: {{ $storage.type }}
  127. datasetName: {{ $storage.datasetName | default "" }}
  128. hostPath: {{ $storage.hostPath | default "" }}
  129. server: {{ $storage.server | default "" }}
  130. share: {{ $storage.share | default "" }}
  131. domain: {{ $storage.domain | default "" }}
  132. username: {{ $storage.username | default "" }}
  133. password: {{ $storage.password | default "" }}
  134. size: {{ $size }}
  135. {{- if eq $storage.type "smb-pv-pvc" }}
  136. mountOptions:
  137. - key: noperm
  138. {{- end }}
  139. targetSelector:
  140. tdarr:
  141. tdarr:
  142. mountPath: {{ $storage.mountPath }}
  143. {{- end }}
  144. {{ with .Values.tdarrGPU }}
  145. scaleGPU:
  146. {{ range $key, $value := . }}
  147. - gpu:
  148. {{ $key }}: {{ $value }}
  149. targetSelector:
  150. tdarr:
  151. - tdarr
  152. {{ end }}
  153. {{ end }}
  154. {{- end -}}