2025-08-25 12:35:36 -05:00
# services/jellyfin/deployment.yaml
apiVersion : apps/v1
kind : Deployment
metadata :
name : jellyfin
namespace : jellyfin
labels :
app : jellyfin
spec :
2025-10-07 23:28:40 -05:00
replicas : 1
2025-09-02 19:46:21 -05:00
strategy :
2025-09-02 20:12:29 -05:00
type : RollingUpdate
rollingUpdate :
maxSurge : 0
maxUnavailable : 1
2025-08-25 12:35:36 -05:00
selector :
matchLabels :
app : jellyfin
template :
metadata :
labels :
app : jellyfin
spec :
2025-12-24 15:26:02 -03:00
# Clean up any lingering OIDC artifacts and strip the injected script tag
2025-12-19 21:13:31 -03:00
initContainers :
2025-12-24 15:26:02 -03:00
- name : strip-oidc
image : docker.io/jellyfin/jellyfin:10.11.5
2025-12-20 13:32:36 -03:00
securityContext :
runAsUser : 0
2025-12-24 15:26:02 -03:00
runAsGroup : 0
command :
- /bin/sh
- -c
2025-12-20 13:32:36 -03:00
- |
2025-12-24 15:26:02 -03:00
set -euxo pipefail
cp -a /jellyfin/jellyfin-web/. /web-root
# remove injected OIDC script tags everywhere just in case
for f in $(find /web-root -type f -name 'index.html'); do
sed -i '/oidc\/inject/d' "$f"
printf '%s\n' "$f"
done
# clean any lingering OIDC plugin artifacts on the config volume
rm -rf "/config/plugins/OIDC Authentication_"* /config/plugins/configurations/JellyfinOIDCPlugin.v2.xml || true
2025-12-19 21:30:04 -03:00
volumeMounts :
2025-12-24 15:26:02 -03:00
- name : web-root
mountPath : /web-root
2025-12-19 21:30:04 -03:00
- name : config
mountPath : /config
2025-12-24 17:25:07 -03:00
# Force all users to authenticate via the LDAP plugin provider by updating the DB on start.
# This keeps Flux enforcement for auth provider drift (e.g., after UI edits).
- name : set-ldap-auth-provider
image : docker.io/library/alpine:3.20
securityContext :
runAsUser : 0
runAsGroup : 0
command :
- /bin/sh
- -c
- |
set -euxo pipefail
apk add --no-cache sqlite
db="/config/data/jellyfin.db"
if [ -f "$db" ]; then
2026-01-01 12:22:22 -03:00
sqlite3 "$db" "UPDATE Users SET AuthenticationProviderId='Jellyfin.Plugin.LDAP_Auth.LdapAuthenticationProviderPlugin', Password=NULL, EnableLocalPassword=0 WHERE AuthenticationProviderId!='Jellyfin.Plugin.LDAP_Auth.LdapAuthenticationProviderPlugin';"
2025-12-24 17:25:07 -03:00
else
echo "db not found at $db, skipping"
fi
volumeMounts :
- name : config
mountPath : /config
2026-01-01 14:16:08 -03:00
affinity :
nodeAffinity :
requiredDuringSchedulingIgnoredDuringExecution :
nodeSelectorTerms :
- matchExpressions :
- key : kubernetes.io/hostname
operator : In
values :
- titan-20
- titan-21
- titan-22
- titan-24
2025-12-24 15:26:02 -03:00
securityContext :
runAsUser : 1000
fsGroup : 65532
fsGroupChangePolicy : OnRootMismatch
runAsGroup : 65532
2025-08-25 12:35:36 -05:00
runtimeClassName : nvidia
containers :
- name : jellyfin
2025-12-19 21:30:04 -03:00
image : docker.io/jellyfin/jellyfin:10.11.5
2025-08-25 12:35:36 -05:00
imagePullPolicy : IfNotPresent
ports :
- name : http
containerPort : 8096
env :
- name : NVIDIA_DRIVER_CAPABILITIES
value : "compute,video,utility"
- name : JELLYFIN_PublishedServerUrl
value : "https://stream.bstein.dev"
2025-09-18 08:52:58 -05:00
- name : PUID
value : "1000"
- name : PGID
value : "65532"
- name : UMASK
value : "002"
2025-08-25 12:35:36 -05:00
resources :
limits :
2026-01-01 14:16:08 -03:00
nvidia.com/gpu.shared : 1
2025-08-25 12:35:36 -05:00
# cpu: "4"
# memory: 8Gi
requests :
2026-01-01 14:16:08 -03:00
nvidia.com/gpu.shared : 1
2025-08-25 12:35:36 -05:00
cpu : "500m"
memory : 1Gi
volumeMounts :
- name : config
mountPath : /config
2025-12-24 15:26:02 -03:00
# Override LDAP plugin configuration from a secret to avoid embedding credentials in the PVC.
- name : ldap-config
mountPath : /config/plugins/configurations/LDAP-Auth.xml
subPath : ldap-config.xml
2025-08-25 12:35:36 -05:00
- name : cache
mountPath : /cache
- name : media
mountPath : /media
2025-12-24 15:26:02 -03:00
- name : web-root
mountPath : /jellyfin/jellyfin-web
lifecycle :
postStart :
exec :
command :
- /bin/sh
- -c
- |
set -eux
for f in $(find /jellyfin/jellyfin-web -type f -name 'index.html'); do
sed -i '/oidc\/inject/d' "$f" || true
done
2025-08-25 12:35:36 -05:00
securityContext :
2025-12-20 13:32:36 -03:00
runAsUser : 0
runAsGroup : 0
2025-08-25 12:35:36 -05:00
allowPrivilegeEscalation : false
readOnlyRootFilesystem : false
volumes :
2025-12-24 15:26:02 -03:00
- name : web-root
emptyDir : {}
2025-08-25 12:35:36 -05:00
- name : config
persistentVolumeClaim :
2025-09-02 19:46:21 -05:00
claimName : jellyfin-config-astreae
2025-08-25 12:35:36 -05:00
- name : cache
persistentVolumeClaim :
2025-09-02 19:46:21 -05:00
claimName : jellyfin-cache-astreae
2025-08-25 12:35:36 -05:00
- name : media
persistentVolumeClaim :
2025-10-07 23:26:27 -05:00
claimName : jellyfin-media-asteria-new
2025-12-24 15:26:02 -03:00
- name : ldap-config
secret :
secretName : jellyfin-ldap-config
items :
- key : ldap-config.xml
path : ldap-config.xml