_jellyfin.tpl 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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. value: {{ $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" (include "ix.v1.common.helper.makeIntOrNoop" .Values.jellyfinRunAs.user)
  47. "GID" (include "ix.v1.common.helper.makeIntOrNoop" .Values.jellyfinRunAs.group)
  48. "mode" "check"
  49. "type" "install") | 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. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.jellyfinStorage.config) | nindent 4 }}
  70. targetSelector:
  71. jellyfin:
  72. jellyfin:
  73. mountPath: /config
  74. {{- if and (eq .Values.jellyfinStorage.config.type "ixVolume")
  75. (not (.Values.jellyfinStorage.config.ixVolumeConfig | default dict).aclEnable) }}
  76. 01-permissions:
  77. mountPath: /mnt/directories/config
  78. {{- end }}
  79. cache:
  80. enabled: true
  81. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.jellyfinStorage.cache) | nindent 4 }}
  82. targetSelector:
  83. jellyfin:
  84. jellyfin:
  85. mountPath: /cache
  86. {{- if and (eq .Values.jellyfinStorage.cache.type "ixVolume")
  87. (not (.Values.jellyfinStorage.cache.ixVolumeConfig | default dict).aclEnable) }}
  88. 01-permissions:
  89. mountPath: /mnt/directories/cache
  90. {{- end }}
  91. transcode:
  92. enabled: true
  93. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.jellyfinStorage.transcodes) | nindent 4 }}
  94. targetSelector:
  95. jellyfin:
  96. jellyfin:
  97. mountPath: /config/transcodes
  98. {{- if and (eq .Values.jellyfinStorage.transcodes.type "ixVolume")
  99. (not (.Values.jellyfinStorage.transcodes.ixVolumeConfig | default dict).aclEnable) }}
  100. 01-permissions:
  101. mountPath: /mnt/directories/transcodes
  102. {{- end }}
  103. tmp:
  104. enabled: true
  105. type: emptyDir
  106. targetSelector:
  107. jellyfin:
  108. jellyfin:
  109. mountPath: /tmp
  110. {{- range $idx, $storage := .Values.jellyfinStorage.additionalStorages }}
  111. {{ printf "jellyfin-%v:" (int $idx) }}
  112. enabled: true
  113. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  114. targetSelector:
  115. jellyfin:
  116. jellyfin:
  117. mountPath: {{ $storage.mountPath }}
  118. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  119. 01-permissions:
  120. mountPath: /mnt/directories{{ $storage.mountPath }}
  121. {{- end }}
  122. {{- end }}
  123. {{ with .Values.jellyfinGPU }}
  124. scaleGPU:
  125. {{ range $key, $value := . }}
  126. - gpu:
  127. {{ $key }}: {{ $value }}
  128. targetSelector:
  129. jellyfin:
  130. - jellyfin
  131. {{ end }}
  132. {{ end }}
  133. {{- end -}}