diff --git a/charts/jellyfin/README.md.gotmpl b/charts/jellyfin/README.md.gotmpl index 330a79a..51152fc 100644 --- a/charts/jellyfin/README.md.gotmpl +++ b/charts/jellyfin/README.md.gotmpl @@ -58,3 +58,30 @@ helm install -f values.yaml {{ template "chart.valuesSection" . }} {{ template "helm-docs.versionFooter" . }} + +## Hardware acceleration + +Out of the box the pod does not have the necessary permissions to enable hardware acceleration (HWA) in Jellyfin. +Adding the following Helm values should make it enable you to use hardware acceleration features. +Some settings may need to be tweaked depending on the type of device (Intel/AMD/NVIDIA/...) and your container runtime. + +Please refer to the Jellyfin upstream documentation for more information about hardware acceleration: + +```yaml +securityContext: + capabilities: + add: + - "SYS_ADMIN" + drop: + - "ALL" + privileged: false + +extraVolumes: + - name: hwa + hostPath: + path: /dev/dri + +extraVolumeMounts: + - name: hwa + mountPath: /dev/dri +``` diff --git a/charts/jellyfin/templates/deployment.yaml b/charts/jellyfin/templates/deployment.yaml index 84dd24c..3d4d8df 100644 --- a/charts/jellyfin/templates/deployment.yaml +++ b/charts/jellyfin/templates/deployment.yaml @@ -125,6 +125,8 @@ spec: {{- end }} resources: {{ toYaml .Values.resources | indent 12 }} + terminationMessagePolicy: FallbackToLogsOnError + securityContext: {{- toYaml .Values.securityContext | nindent 12 }} {{- if .Values.extraInitContainers }} initContainers: {{- toYaml .Values.extraInitContainers | nindent 10 }} @@ -164,3 +166,4 @@ spec: tolerations: {{ toYaml . | indent 8 }} {{- end }} + securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} diff --git a/charts/jellyfin/values.yaml b/charts/jellyfin/values.yaml index a6bacbd..c383798 100644 --- a/charts/jellyfin/values.yaml +++ b/charts/jellyfin/values.yaml @@ -127,6 +127,21 @@ extraInitContainers: {} # -- additional sidecar containers to run inside the pod. extraContainers: {} +# -- SecurityContext configuration for the Jellyfin pod +podSecurityContext: {} +# Jellyfin can be run as an unprivileged user with the following settings: + # runAsUser: 65534 + # runAsGroup: 65534 + +# -- SecurityContext configuration for the Jellyfin container +securityContext: {} +# For example, you might need to grant the following capabilities to enable hardware acceleration when mounting a /dev/dri device: + # capabilities: + # add: + # - "SYS_ADMIN" + # drop: + # - "ALL" + # -- Larger libraries may need to increase the readinessProbe and livenessProbe timeouts. Start by increasing the initialDelaySeconds. livenessProbe: enabled: true