Sync HTPC Manifests to GitOps / Sync Manifests to GitOps Repo (push) Successful in 4s
134 lines
4.3 KiB
YAML
134 lines
4.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: jellyfin
|
|
namespace: htpc
|
|
labels:
|
|
app.kubernetes.io/name: jellyfin
|
|
app.kubernetes.io/part-of: htpc
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: jellyfin
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: jellyfin
|
|
app.kubernetes.io/name: jellyfin
|
|
app.kubernetes.io/part-of: htpc
|
|
spec:
|
|
nodeSelector:
|
|
kubernetes.io/hostname: vmserver
|
|
initContainers:
|
|
- name: migrate-config
|
|
image: lscr.io/linuxserver/jellyfin:latest
|
|
imagePullPolicy: IfNotPresent
|
|
command:
|
|
- /bin/bash
|
|
- -c
|
|
- |
|
|
if [ ! -f /config/system.xml ] && [ -f /host-etc/system.xml ]; then
|
|
echo "Syncing Jellyfin configuration from /etc/jellyfin..."
|
|
cp -a /host-etc/* /config/
|
|
sed -i 's|<MetadataPath>/var/lib/jellyfin/metadata</MetadataPath>|<MetadataPath>/config/metadata</MetadataPath>|g' /config/system.xml || true
|
|
sed -i 's|<CachePath>/var/cache/jellyfin</CachePath>|<CachePath>/config/cache</CachePath>|g' /config/system.xml || true
|
|
fi
|
|
if [ ! -f /config/data/jellyfin.db ] && [ -d /host-data/data ]; then
|
|
echo "Syncing Jellyfin data, metadata, plugins and root from /var/lib/jellyfin..."
|
|
mkdir -p /config/data /config/metadata /config/plugins /config/root
|
|
[ -d /host-data/data ] && cp -a /host-data/data/* /config/data/ || true
|
|
[ -d /host-data/metadata ] && cp -a /host-data/metadata/* /config/metadata/ || true
|
|
[ -d /host-data/plugins ] && cp -a /host-data/plugins/* /config/plugins/ || true
|
|
[ -d /host-data/root ] && cp -a /host-data/root/* /config/root/ || true
|
|
fi
|
|
chown -R 33:33 /config
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: host-etc
|
|
mountPath: /host-etc
|
|
readOnly: true
|
|
- name: host-data
|
|
mountPath: /host-data
|
|
readOnly: true
|
|
containers:
|
|
- name: jellyfin
|
|
image: lscr.io/linuxserver/jellyfin:latest
|
|
imagePullPolicy: IfNotPresent
|
|
securityContext:
|
|
privileged: true
|
|
env:
|
|
- name: PUID
|
|
value: "33"
|
|
- name: PGID
|
|
value: "33"
|
|
- name: TZ
|
|
value: "Europe/Amsterdam"
|
|
- name: DOTNET_gcServer
|
|
value: "0"
|
|
- name: DOTNET_GCHeapHardLimit
|
|
value: "0x160000000"
|
|
- name: DOTNET_GCLargeObjectHeapCompactionMode
|
|
value: "1"
|
|
ports:
|
|
- name: http
|
|
containerPort: 8096
|
|
hostPort: 8096
|
|
resources:
|
|
requests:
|
|
cpu: 200m
|
|
memory: 1Gi
|
|
limits:
|
|
cpu: 4000m
|
|
memory: 8Gi
|
|
volumeMounts:
|
|
- name: config
|
|
mountPath: /config
|
|
- name: datadisk
|
|
mountPath: /datadisk
|
|
- name: mnt-mp3
|
|
mountPath: /mnt/mp3
|
|
- name: dri
|
|
mountPath: /dev/dri
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /jellyfin/health
|
|
port: 8096
|
|
initialDelaySeconds: 60
|
|
periodSeconds: 20
|
|
timeoutSeconds: 5
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /jellyfin/health
|
|
port: 8096
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
volumes:
|
|
- name: config
|
|
persistentVolumeClaim:
|
|
claimName: jellyfin-config
|
|
- name: datadisk
|
|
hostPath:
|
|
path: /datadisk
|
|
type: Directory
|
|
- name: mnt-mp3
|
|
hostPath:
|
|
path: /mnt/mp3
|
|
type: Directory
|
|
- name: dri
|
|
hostPath:
|
|
path: /dev/dri
|
|
type: Directory
|
|
- name: host-etc
|
|
hostPath:
|
|
path: /etc/jellyfin
|
|
type: DirectoryOrCreate
|
|
- name: host-data
|
|
hostPath:
|
|
path: /var/lib/jellyfin
|
|
type: DirectoryOrCreate
|