apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: jellyfin
  namespace: streaming
  labels:
    app: jellyfin
    category: streaming
spec:
  serviceName: jellyfin
  replicas: 1
  selector:
    matchLabels:
      app: jellyfin
      category: streaming
  template:
    metadata:
      name: jellyfin
      namespace: streaming
      labels:
        app: jellyfin
        category: streaming
    spec:      
      nodeName: nodebook
      containers:
        - name: jellyfin
          image: lscr.io/linuxserver/jellyfin:nightly
          imagePullPolicy: Always
          securityContext:
            privileged: true
          env:
            - name: PUID
              value: "1000"
            - name: PGID
              value: "1000"
            - name: TZ
              value: "Europe/Vienna"
            - name: DOCKER_MODS
              value: "linuxserver/mods:jellyfin-amd"
          ports:
            - containerPort: 8096
              name: http
          volumeMounts:
            - name: config
              mountPath: /config              
            - name: books
              mountPath: /data/books
            - name: tv
              mountPath: /data/tv              
            - name: movies
              mountPath: /data/movies              
            - name: dev-card0
              mountPath: /dev/dri/card0              
            - name: dev-kfd
              mountPath: /dev/kfd
            - name: dev-renderd128
              mountPath: /dev/dri/renderD128
      volumes:
        - name: movies
          hostPath:
            path: /media/streaming/movies
        - name: tv
          hostPath:
            path: /media/streaming/tv
        - name: books
          hostPath:
            path: /media/streaming/books
        - name: dev-kfd
          hostPath:
            path: /dev/kfd
        - name: dev-card0
          hostPath:
            path: /dev/dri/card0
        - name: dev-renderd128
          hostPath:
            path: /dev/dri/renderD128   
        - name: config
          hostPath:
            path: /srv/jellyfin
