100 lines
2.6 KiB
YAML
100 lines
2.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: jellyfin
|
|
namespace: jellyfin
|
|
labels:
|
|
app: jellyfin
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: jellyfin
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: jellyfin
|
|
spec:
|
|
initContainers:
|
|
- name: migrate-data
|
|
image: busybox:1.36
|
|
command:
|
|
- sh
|
|
- -c
|
|
- |
|
|
cd /config/data
|
|
for db in *.db; do
|
|
[ -f "$db" ] && [ ! -L "$db" ] || continue
|
|
echo "Migrating $db to local storage..."
|
|
cp "$db" "/db-local/$db"
|
|
rm "$db"
|
|
ln -sf "/db-local/$db" "$db"
|
|
done
|
|
echo "Done"
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: data
|
|
mountPath: /db-local
|
|
containers:
|
|
- name: jellyfin
|
|
image: jellyfin/jellyfin:10.11.6
|
|
env:
|
|
- name: JELLYFIN_PublishedServerUrl
|
|
value: https://${JELLYFIN_HOST}
|
|
ports:
|
|
- containerPort: 8096
|
|
name: http
|
|
protocol: TCP
|
|
- containerPort: 7359
|
|
name: discovery
|
|
protocol: UDP
|
|
hostPort: 7359
|
|
- containerPort: 1900
|
|
name: dlna
|
|
protocol: UDP
|
|
hostPort: 1900
|
|
resources:
|
|
limits:
|
|
gpu.intel.com/i915: "1"
|
|
livenessProbe:
|
|
httpGet:
|
|
port: 8096
|
|
path: /health
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 30
|
|
timeoutSeconds: 5
|
|
failureThreshold: 5
|
|
readinessProbe:
|
|
httpGet:
|
|
port: 8096
|
|
path: /health
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: data
|
|
mountPath: /db-local
|
|
- name: cache
|
|
mountPath: /cache
|
|
- name: media
|
|
mountPath: /media
|
|
subPath: complete
|
|
volumes:
|
|
- name: config
|
|
persistentVolumeClaim:
|
|
claimName: jellyfin-config
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: jellyfin-data
|
|
- name: cache
|
|
persistentVolumeClaim:
|
|
claimName: jellyfin-cache
|
|
- name: media
|
|
persistentVolumeClaim:
|
|
claimName: jellyfin-media
|