_jellyfin.tpl 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. {{/* Service */}}
  45. service:
  46. jellyfin:
  47. enabled: true
  48. primary: true
  49. type: NodePort
  50. targetSelector: jellyfin
  51. ports:
  52. webui:
  53. enabled: true
  54. primary: true
  55. port: {{ .Values.jellyfinNetwork.webPort }}
  56. nodePort: {{ .Values.jellyfinNetwork.webPort }}
  57. targetPort: 8096
  58. targetSelector: jellyfin
  59. {{/* Persistence */}}
  60. persistence:
  61. config:
  62. enabled: true
  63. {{- include "jellyfin.storage.ci.migration" (dict "storage" .Values.jellyfinStorage.config) }}
  64. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.jellyfinStorage.config) | nindent 4 }}
  65. targetSelector:
  66. jellyfin:
  67. jellyfin:
  68. mountPath: /config
  69. cache:
  70. enabled: true
  71. {{- include "jellyfin.storage.ci.migration" (dict "storage" .Values.jellyfinStorage.cache) }}
  72. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.jellyfinStorage.cache) | nindent 4 }}
  73. targetSelector:
  74. jellyfin:
  75. jellyfin:
  76. mountPath: /cache
  77. transcode:
  78. enabled: true
  79. {{- include "jellyfin.storage.ci.migration" (dict "storage" .Values.jellyfinStorage.transcodes) }}
  80. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.jellyfinStorage.transcodes) | nindent 4 }}
  81. targetSelector:
  82. jellyfin:
  83. jellyfin:
  84. mountPath: /config/transcodes
  85. tmp:
  86. enabled: true
  87. type: emptyDir
  88. targetSelector:
  89. jellyfin:
  90. jellyfin:
  91. mountPath: /tmp
  92. {{- range $idx, $storage := .Values.jellyfinStorage.additionalStorages }}
  93. {{ printf "jellyfin-%v:" (int $idx) }}
  94. enabled: true
  95. {{- include "jellyfin.storage.ci.migration" (dict "storage" $storage) }}
  96. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  97. targetSelector:
  98. jellyfin:
  99. jellyfin:
  100. mountPath: {{ $storage.mountPath }}
  101. {{- end }}
  102. {{ with .Values.jellyfinGPU }}
  103. scaleGPU:
  104. {{ range $key, $value := . }}
  105. - gpu:
  106. {{ $key }}: {{ $value }}
  107. targetSelector:
  108. jellyfin:
  109. - jellyfin
  110. {{ end }}
  111. {{ end }}
  112. {{- end -}}
  113. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  114. {{- define "jellyfin.storage.ci.migration" -}}
  115. {{- $storage := .storage -}}
  116. {{- if $storage.hostPath -}}
  117. {{- $_ := set $storage "hostPathConfig" dict -}}
  118. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  119. {{- end -}}
  120. {{- if (hasKey $storage "medium") -}}
  121. {{- $_ := set $storage "emptyDirConfig" dict -}}
  122. {{- $_ := set $storage.emptyDirConfig "medium" $storage.medium -}}
  123. {{- $_ := set $storage.emptyDirConfig "size" 1 -}}
  124. {{- end -}}
  125. {{- end -}}