Skip to content

Instantly share code, notes, and snippets.

@sean-m
Last active November 5, 2022 02:26
Show Gist options
  • Save sean-m/13d61aa8ac696f82a7c86af7b53837cb to your computer and use it in GitHub Desktop.
Save sean-m/13d61aa8ac696f82a7c86af7b53837cb to your computer and use it in GitHub Desktop.
Jellyfin Podman play kubernetes yaml file. Allows using Podman's kubernetes-ish pod deployment for Jellyfin with Intel quicksync. This started as a docker-compose but moved to podman with podman-compose to create the pod then 'podman genenerate kube' to create the yml, then 'podman play kube' to run that config.
# Save the output of this file and use kubectl create -f to import
# it into Kubernetes.
#
# Created with podman-4.0.2
#
# Where you see: /bulk/*, update those paths to correlate with your filesystem. Note: /dev/dri is what
# passes through devices for Intel Quick Sync hardware encoding. For me that dropped CPU usage on 4k
# video from 90% to 2% on 8th gen i5.
#
# After running $ podman play kube jelly-kube.yml, run the following command to generate systemd unit files:
# $ podman generate systemd --files --name jellyfin_pod
#
# This generates: pod-jellyfin_pod.service and container-jellyfin_pod-jellyfin.service
# Copy those to: ~/.config/systemd/user
# to make the service visible to the user systemd: $ systemctl --user daemon-reload
# Enable starting the pod automatically $ systemctl --user enable pod-jellyfin_pod
#
# Running: $ podman ps will show two containers running, one is infrastructure for the
# pod and handles things like network config for running multiple containers in a shared
# network namespace. The other is Jellyfin itself.
#
# NOTE: If you generated this yaml from an unprivileged and rootless podman container on an SELinux
# enabled system, check the podman generate kube man page for steps to follow to ensure that your pod/container
# has the right permissions to access the volumes added.
---
apiVersion: v1
kind: Pod
metadata:
annotations:
bind-mount-options:/bulk/jellyfin: Z
bind-mount-options:/bulk/media: Z
creationTimestamp: "2022-08-28T17:42:52Z"
labels:
app: jellyfinpod
name: jellyfin_pod
spec:
containers:
- image: docker.io/jellyfin/jellyfin:latest
name: jellyfin
securityContext:
fsGroup: 1000
seLinuxOptions:
level: "s0:c286,c880"
capabilities:
drop:
- CAP_MKNOD
- CAP_AUDIT_WRITE
ports:
- containerPort: 8920
hostPort: 8920
- containerPort: 8096
hostPort: 8096
- containerPort: 7359
hostPort: 7359
- containerPort: 1900
hostPort: 1900
volumeMounts:
- mountPath: /dev/dri
name: host-dri
- mountPath: /config
name: bulk-jellyfin-host-0
- mountPath: /media
name: bulk-media-host-1
- mountPath: /cache
name: cache-pvc
hostNetwork: false
volumes:
- hostPath:
path: /dev/dri
type: Directory
name: host-dri
- hostPath:
path: /bulk/jellyfin
type: Directory
name: bulk-jellyfin-host-0
- hostPath:
path: /bulk/media
type: Directory
name: bulk-media-host-1
- name: cache-pvc
persistentVolumeClaim:
claimName: cb2a18666e03138cff2f76c4fe01ecaca01e7c501177ec1c5cdb8cfb3ecefed3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment