updated readme and restructure project

This commit is contained in:
2025-02-28 20:04:52 +02:00
parent 8e8d1a65e2
commit efdaba6169
60 changed files with 109 additions and 120 deletions

View File

@ -0,0 +1,103 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: jellyfin-network-config
data:
network.xml: |
<?xml version="1.0" encoding="utf-8"?>
<NetworkConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BaseUrl>/</BaseUrl>
<EnableHttps>true</EnableHttps>
<RequireHttps>true</RequireHttps>
<InternalHttpPort>8096</InternalHttpPort>
<InternalHttpsPort>8920</InternalHttpsPort>
<PublicHttpPort>80</PublicHttpPort>
<PublicHttpsPort>443</PublicHttpsPort>
<EnableRemoteAccess>true</EnableRemoteAccess>
<EnablePublishedServerUriByRequest>true</EnablePublishedServerUriByRequest>
<PublishedServerUri>https://${JELLYFIN_HOST}</PublishedServerUri>
</NetworkConfiguration>
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: jellyfin
spec:
replicas: 1
selector:
matchLabels:
app: jellyfin
template:
metadata:
labels:
app: jellyfin
spec:
containers:
- name: jellyfin
image: jellyfin/jellyfin:latest
ports:
- containerPort: 8096
volumeMounts:
- name: plex-media
mountPath: /media
- name: config
mountPath: /config
- name: network-config
mountPath: /config/config/ network.xml
subPath: network.xml
volumes:
- name: plex-media
persistentVolumeClaim:
claimName: media-nfs-pvc
- name: config
persistentVolumeClaim:
claimName: plex-config-pvc
- name: network-config
configMap:
name: jellyfin-network-config
---
apiVersion: v1
kind: Service
metadata:
name: jellyfin-service
spec:
selector:
app: jellyfin
ports:
- protocol: TCP
port: 8096
targetPort: 8096
type: ClusterIP
---
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: jellyfin-ingress
annotations:
traefik.ingress.kubernetes.io/router.middlewares: jellyfin-headers@kubernetescrd
spec:
entryPoints:
- websecure
routes:
- match: Host(`${JELLYFIN_HOST}`)
kind: Rule
services:
- name: jellyfin-service
port: 8096
tls:
secretName: wildcard-cert-secret
---
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:
name: jellyfin-headers
spec:
headers:
customRequestHeaders:
X-Forwarded-Proto: "https"
customResponseHeaders:
X-Frame-Options: "SAMEORIGIN"

16
kubernetes/media/pv.yaml Normal file
View File

@ -0,0 +1,16 @@
apiVersion: v1
kind: PersistentVolume
metadata:
name: media-nfs-pv
labels:
app: media
spec:
capacity:
storage: 900Gi
accessModes:
- ReadWriteMany
nfs:
path: /media/flexdrive # Path to your NFS share
server: "${NFS_SERVER}" # IP of your NFS server (replace with correct IP)
persistentVolumeReclaimPolicy: Retain
storageClassName: manual

View File

@ -0,0 +1,11 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: plex-config-pvc
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi # Storage for Jellyfin config files
storageClassName: longhorn # Make sure this matches your Longhorn storage class

14
kubernetes/media/pvc.yaml Normal file
View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: media-nfs-pvc
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 900Gi
storageClassName: manual
selector:
matchLabels:
app: media

View File

@ -0,0 +1,6 @@
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: manual
provisioner: kubernetes.io/no-provisioner
volumeBindingMode: WaitForFirstConsumer

View File

@ -0,0 +1,22 @@
apiVersion: v1
kind: Pod
metadata:
name: media-transfer-pod
spec:
restartPolicy: Never
containers:
- name: media-transfer
image: alpine # Use a lightweight image
command: ["/bin/sh", "-c", "sleep 3600"] # Keep the pod alive
volumeMounts:
- name: plex-media
mountPath: /mnt/longhorn
- name: existing-media
mountPath: /mnt/existing
volumes:
- name: plex-media
persistentVolumeClaim:
claimName: plex-media-longhorn
- name: existing-media
persistentVolumeClaim:
claimName: plex-media-pvc