apiVersion: apps/v1 kind: Deployment metadata: name: jellyfin-server namespace: services spec: replicas: 1 # Recreate so the old pod fully terminates before the new one starts — # avoids NFS-lock races on the hostPath-backed PVC during rolling updates. strategy: type: Recreate selector: matchLabels: app: jellyfin-server template: metadata: labels: app: jellyfin-server spec: initContainers: - name: nfs-check-config image: busybox:stable command: - sh - -c - | test -f /mnt/.nfs-sentinel || ( echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel" echo "refusing to start; node likely has NFS unmounted" echo "pod would otherwise bind-mount the local-XFS shadow" exit 1 ) volumeMounts: - name: jellyfin-config mountPath: /mnt readOnly: true - name: nfs-check-libraries image: busybox:stable command: - sh - -c - | test -f /mnt/.nfs-sentinel || ( echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel" echo "refusing to start; node likely has NFS unmounted" echo "pod would otherwise bind-mount the local-XFS shadow" exit 1 ) volumeMounts: - name: jellyfin-libraries mountPath: /mnt readOnly: true - name: nfs-check-data image: busybox:stable command: - sh - -c - | test -f /mnt/.nfs-sentinel || ( echo "ERROR: NFS sentinel missing at /mnt/.nfs-sentinel" echo "refusing to start; node likely has NFS unmounted" echo "pod would otherwise bind-mount the local-XFS shadow" exit 1 ) volumeMounts: - name: jellyfin-data mountPath: /mnt readOnly: true containers: - name: jellyfin image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" ports: - containerPort: 8096 name: http resources: requests: cpu: 500m memory: 512Mi limits: cpu: 4000m memory: 4Gi volumeMounts: - name: jellyfin-config mountPath: /config - name: jellyfin-libraries mountPath: /media/libraries - name: jellyfin-data mountPath: /data volumes: - name: jellyfin-config persistentVolumeClaim: claimName: jellyfin-config-pvc - name: jellyfin-libraries persistentVolumeClaim: claimName: jellyfin-libraries-pvc - name: jellyfin-data persistentVolumeClaim: claimName: jellyfin-data-pvc --- apiVersion: v1 kind: Service metadata: labels: app: jellyfin-server name: jellyfin-server namespace: services spec: type: NodePort ports: - name: http port: 8096 protocol: TCP targetPort: 8096 nodePort: 30096 - name: https port: 8920 protocol: TCP targetPort: 8096 nodePort: 30920 selector: app: jellyfin-server