add media back

This commit is contained in:
Remy Moll 2024-03-27 00:27:57 +01:00
parent e674bf5b94
commit ffed2aea50
9 changed files with 261 additions and 0 deletions

63
apps/media/ingress.yaml Normal file
View File

@ -0,0 +1,63 @@
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: jellyfin-vue-ingress
namespace: media
spec:
entryPoints:
- websecure
routes:
- match: Host(`media.kluster.moll.re`)
middlewares:
- name: jellyfin-websocket
kind: Rule
services:
- name: jellyfin-web
port: 80
tls:
certResolver: default-tls
---
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: jellyfin-backend-ingress
namespace: media
spec:
entryPoints:
- websecure
routes:
- match: Host(`media-backend.kluster.moll.re`) && !Path(`/metrics`)
middlewares:
- name: jellyfin-websocket
- name: jellyfin-server-headers
kind: Rule
services:
- name: jellyfin-server
port: 8096
tls:
certResolver: default-tls
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: jellyfin-websocket
namespace: media
spec:
headers:
customRequestHeaders:
Connection: keep-alive, Upgrade
Upgrade: WebSocket
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: jellyfin-server-headers
namespace: media
spec:
headers:
accessControlAllowCredentials: true
accessControlAllowHeaders: [ "Authorization","Content-Type" ] # "Accept","Origin"
accessControlAllowMethods: [ "GET","HEAD","OPTIONS" ] # "POST","PUT"
accessControlAllowOriginList:
- "*"
accessControlMaxAge: 100

View File

@ -0,0 +1,17 @@
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: jellyfin
labels:
metrics: prometheus
spec:
selector:
matchLabels:
app: jellyfin-server-service
endpoints:
- path: /metrics
targetPort: jellyfin
# this exposes metrics on port 8096 as enabled in the jellyfin config
# https://jellyfin.org/docs/general/networking/monitoring/
# the metrics are available at /metrics but blocked by the ingress

View File

@ -0,0 +1,21 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
namespace: media
resources:
- namespace.yaml
- pvc.yaml
- server.deployment.yaml
- server.service.yaml
- web.deployment.yaml
- web.service.yaml
- ingress.yaml
- jellyfin.servicemonitor.yaml
images:
- name: jellyfin/jellyfin
newName: jellyfin/jellyfin
newTag: 10.8.13
- name: ghcr.io/jellyfin/jellyfin-vue
newName: ghcr.io/jellyfin/jellyfin-vue
newTag: stable-rc.0.3.1

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: placeholder

58
apps/media/pvc.yaml Normal file
View File

@ -0,0 +1,58 @@
apiVersion: v1
kind: PersistentVolume
metadata:
namespace: media
name: jellyfin-config-nfs
spec:
capacity:
storage: "1Gi"
accessModes:
- ReadWriteOnce
nfs:
path: /export/kluster/jellyfin-config
server: 192.168.1.157
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: media
name: jellyfin-config-nfs
spec:
storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "1Gi"
volumeName: jellyfin-config-nfs
---
apiVersion: v1
kind: PersistentVolume
metadata:
namespace: media
name: jellyfin-data-nfs
spec:
capacity:
storage: "1Ti"
accessModes:
- ReadWriteOnce
nfs:
path: /export/jellyfin-media
server: 192.168.1.157
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
namespace: media
name: jellyfin-data-nfs
spec:
storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests:
storage: "1Ti"
volumeName: jellyfin-data-nfs

View File

@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: jellyfin-server
spec:
selector:
matchLabels:
app: jellyfin-server
template:
metadata:
labels:
app: jellyfin-server
spec:
containers:
- name: jellyfin-server
image: jellyfin/jellyfin
resources:
limits:
memory: "2Gi"
cpu: "2"
ports:
- containerPort: 8096
name: jellyfin
env:
- name: TZ
value: Europe/Berlin
volumeMounts:
- name: jellyfin-config
mountPath: /config
- name: jellyfin-data
mountPath: /media
livenessProbe:
httpGet:
path: /health
port: 8096
initialDelaySeconds: 100
periodSeconds: 15
volumes:
- name: jellyfin-config
persistentVolumeClaim:
claimName: jellyfin-config-nfs
- name: jellyfin-data
persistentVolumeClaim:
claimName: jellyfin-data-nfs

View File

@ -0,0 +1,14 @@
apiVersion: v1
kind: Service
metadata:
name: jellyfin-server
labels:
app: jellyfin-server-service
spec:
selector:
app: jellyfin-server
ports:
- protocol: TCP
port: 8096
targetPort: 8096

View File

@ -0,0 +1,27 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: jellyfin-web
spec:
selector:
matchLabels:
app: jellyfin-web
template:
metadata:
labels:
app: jellyfin-web
spec:
containers:
- name: jellyfin-web
image: ghcr.io/jellyfin/jellyfin-vue
resources:
limits:
memory: "128Mi"
cpu: "30m"
ports:
- containerPort: 80
env:
- name: TZ
value: Europe/Berlin
- name: DEFAULT_SERVERS
value: "https://media-backend.kluster.moll.re"

View File

@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: jellyfin-web
spec:
selector:
app: jellyfin-web
ports:
- protocol: TCP
port: 80
targetPort: 80