---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: jellyfin
spec:
  replicas: 1
  selector:
    matchLabels:
      app: jellyfin
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: jellyfin
    spec:
      containers:
        - image: jellyfin/jellyfin:latest
          name: jellyfin
          ports:
            - containerPort: 8096
              protocol: TCP
          envFrom:
            - configMapRef:
                name: config
          env:
            - name: TZ
              valueFrom:
                configMapKeyRef:
                  key: TZ
                  name: config
          volumeMounts:
            - mountPath: /config
              name: jellyfin-config
            - mountPath: /cache
              name: jellyfin-cache
            - mountPath: /media
              name: jellyfin-media
      volumes:
        - name: jellyfin-config
          persistentVolumeClaim:
            claimName: jellyfin-config-pvc
        - name: jellyfin-cache
          persistentVolumeClaim:
            claimName: jellyfin-cache-pvc
        - name: jellyfin-media
          persistentVolumeClaim:
            claimName: jellyfin-media-pvc