1
0
Fork 0
home-stack-kustomize/kustomize/bases/jellyfin/jellyfin-deployment.yaml

128 lines
3.4 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: server
labels:
app.kubernetes.io/name: jellyfin
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: jellyfin
template:
metadata:
labels:
app.kubernetes.io/name: jellyfin
spec:
# securityContext:
# runAsUser: 33
# runAsGroup: 33
# fsGroup: 33
affinity:
nodeAffinity:
# TODO: eviction policy
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
# we require to be scheduled on a raspberry pi for hardware transcoding to work
- key: kubernetes.io/arch
operator: In
values:
- arm64
containers:
- image: jellyfin/jellyfin
name: jellyfin
securityContext:
privileged: true # required for hardware transcode
env:
- name: JELLYFIN_PublishedServerUrl
value: ${JELLYFIN_EXTERNAL_URL}
- name: JELLYFIN_CONFIG_DIR
value: /config
- name: JELLYFIN_CACHE_DIR
value: /cache
ports:
- name: http
containerPort: 8096
resources:
requests:
cpu: 2000m
memory: 2Gi
limits:
cpu: 3500m
memory: 2Gi
volumeMounts:
- name: jellyfin-config-pvc
mountPath: /config
- name: jellyfin-cache-pvc
mountPath: /cache
- name: jellyfin-transcode
mountPath: /config/transcodes
# below mounts are for hardware transcode
- mountPath: /dev/video10
name: device-video10
- mountPath: /dev/video11
name: device-video11
- mountPath: /dev/video12
name: device-video12
volumes:
- name: jellyfin-config-pvc
persistentVolumeClaim:
claimName: jellyfin-config-pvc
- name: jellyfin-cache-pvc
persistentVolumeClaim:
claimName: jellyfin-cache-pvc
- name: jellyfin-transcode
emptyDir:
sizeLimit: 80Gi
- name: device-video10 #Only needed if you want to use your Raspberry Pi V4L2 video encoding.
hostPath:
path: /dev/video10
- name: device-video11 #Only needed if you want to use your Raspberry Pi V4L2 video encoding.
hostPath:
path: /dev/video11
- name: device-video12 #Only needed if you want to use your Raspberry Pi V4L2 video encoding.
hostPath:
path: /dev/video12
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jellyfin-config-pvc
labels:
app.kubernetes.io/name: jellyfin
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jellyfin-cache-pvc
labels:
app.kubernetes.io/name: jellyfin
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 20Gi
---
apiVersion: v1
kind: Service
metadata:
name: server
labels:
app.kubernetes.io/name: jellyfin
spec:
selector:
app.kubernetes.io/name: jellyfin
ports:
- name: http
port: 80
targetPort: http