_jellyfin.tpl 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. {{- define "jellyfin.workload" -}}
  2. workload:
  3. jellyfin:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.jellyfinNetwork.hostNetwork }}
  9. containers:
  10. jellyfin:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: {{ .Values.jellyfinRunAs.user }}
  16. runAsGroup: {{ .Values.jellyfinRunAs.group }}
  17. env:
  18. {{ with .Values.jellyfinConfig.publishedServerUrl }}
  19. JELLYFIN_PublishedServerUrl: {{ . | quote }}
  20. {{ end }}
  21. {{ with .Values.jellyfinConfig.additionalEnvs }}
  22. envList:
  23. {{ range $env := . }}
  24. - name: {{ $env.name }}
  25. values: {{ $env.value }}
  26. {{ end }}
  27. {{ end }}
  28. probes:
  29. liveness:
  30. enabled: true
  31. type: http
  32. port: 8096
  33. path: /health
  34. readiness:
  35. enabled: true
  36. type: http
  37. port: 8096
  38. path: /health
  39. startup:
  40. enabled: true
  41. type: http
  42. port: 8096
  43. path: /health
  44. initContainers:
  45. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  46. "UID" .Values.jellyfinRunAs.user
  47. "GID" .Values.jellyfinRunAs.group
  48. "mode" "check"
  49. "type" "init") | nindent 8 }}
  50. {{/* Service */}}
  51. service:
  52. jellyfin:
  53. enabled: true
  54. primary: true
  55. type: NodePort
  56. targetSelector: jellyfin
  57. ports:
  58. webui:
  59. enabled: true
  60. primary: true
  61. port: {{ .Values.jellyfinNetwork.webPort }}
  62. nodePort: {{ .Values.jellyfinNetwork.webPort }}
  63. targetPort: 8096
  64. targetSelector: jellyfin
  65. {{/* Persistence */}}
  66. persistence:
  67. config:
  68. enabled: true
  69. type: {{ .Values.jellyfinStorage.config.type }}
  70. datasetName: {{ .Values.jellyfinStorage.config.datasetName | default "" }}
  71. hostPath: {{ .Values.jellyfinStorage.config.hostPath | default "" }}
  72. targetSelector:
  73. jellyfin:
  74. jellyfin:
  75. mountPath: /config
  76. 01-permissions:
  77. mountPath: /mnt/directories/config
  78. cache:
  79. enabled: true
  80. type: {{ .Values.jellyfinStorage.cache.type }}
  81. datasetName: {{ .Values.jellyfinStorage.cache.datasetName | default "" }}
  82. hostPath: {{ .Values.jellyfinStorage.cache.hostPath | default "" }}
  83. targetSelector:
  84. jellyfin:
  85. jellyfin:
  86. mountPath: /cache
  87. 01-permissions:
  88. mountPath: /mnt/directories/cache
  89. transcode:
  90. enabled: true
  91. type: {{ .Values.jellyfinStorage.transcodes.type }}
  92. datasetName: {{ .Values.jellyfinStorage.transcodes.datasetName | default "" }}
  93. hostPath: {{ .Values.jellyfinStorage.transcodes.hostPath | default "" }}
  94. medium: {{ .Values.jellyfinStorage.transcodes.medium | default "" }}
  95. {{/* Size of the emptyDir */}}
  96. size: {{ .Values.jellyfinStorage.transcodes.size | default "" }}
  97. targetSelector:
  98. jellyfin:
  99. jellyfin:
  100. mountPath: /config/transcodes
  101. {{ if ne .Values.jellyfinStorage.transcodes.type "emptyDir" }}
  102. 01-permissions:
  103. mountPath: /mnt/directories/transcodes
  104. {{ end }}
  105. tmp:
  106. enabled: true
  107. type: emptyDir
  108. targetSelector:
  109. jellyfin:
  110. jellyfin:
  111. mountPath: /tmp
  112. {{- range $idx, $storage := .Values.jellyfinStorage.additionalStorages }}
  113. {{ printf "jellyfin-%v" (int $idx) }}:
  114. enabled: true
  115. type: {{ $storage.type }}
  116. datasetName: {{ $storage.datasetName | default "" }}
  117. hostPath: {{ $storage.hostPath | default "" }}
  118. targetSelector:
  119. jellyfin:
  120. jellyfin:
  121. mountPath: {{ $storage.mountPath }}
  122. 01-permissions:
  123. mountPath: /mnt/directories{{ $storage.mountPath }}
  124. {{- end }}
  125. {{ with .Values.jellyfinGPU }}
  126. scaleGPU:
  127. {{ range $key, $value := . }}
  128. - gpu:
  129. {{ $key }}: {{ $value }}
  130. targetSelector:
  131. jellyfin:
  132. - jellyfin
  133. {{ end }}
  134. {{ end }}
  135. {{- end -}}