diff --git a/streaming/jellyfin/deployment.yaml b/streaming/jellyfin/deployment.yaml new file mode 100644 index 0000000..74aafec --- /dev/null +++ b/streaming/jellyfin/deployment.yaml @@ -0,0 +1,43 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: jellyfin + namespace: streaming +spec: + replicas: 1 + selector: + matchLabels: + app: jellyfin + template: + metadata: + labels: + app: jellyfin + spec: + hostname: jellyfin + subdomain: jellyfin + containers: + - name: jellyfin + image: jellyfin/jellyfin:10.8.9 + ports: + - containerPort: 8096 + env: + - name: PUID + value: "1000" + - name: PGID + value: "1000" + - name: TZ + value: "Europe/Copenhagen" + volumeMounts: + - mountPath: "/config" + name: jellyfin-pvc + - mountPath: "/shows" + name: jellyfin-shows + volumes: + - name: jellyfin-pvc + persistentVolumeClaim: + claimName: jellyfin-pvc + - name: jellyfin-shows + persistentVolumeClaim: + claimName: jellyfin-shows + nodeSelector: + type: "wide" diff --git a/streaming/jellyfin/ingress.yaml b/streaming/jellyfin/ingress.yaml new file mode 100644 index 0000000..41f0c38 --- /dev/null +++ b/streaming/jellyfin/ingress.yaml @@ -0,0 +1,31 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: jellyfin-ingress + namespace: streaming + annotations: + kubernetes.io/ingress.class: "traefik" + ingress.kubernetes.io/rewrite-target: / +spec: + tls: + - secretName: jellyfin-beta-tls + hosts: + - stream.beta.halia.dev + rules: + - host: stream.beta.halia.dev + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: jellyfin-svc + port: + number: 80 + - path: /metrics + pathType: Prefix + backend: + service: + name: jellyfin-svc + port: + number: 80 diff --git a/streaming/jellyfin/kustomization.yaml b/streaming/jellyfin/kustomization.yaml new file mode 100644 index 0000000..090316d --- /dev/null +++ b/streaming/jellyfin/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - pvc.yaml + - service.yaml + - ingress.yaml + - configmap.yaml + - deployment.yaml diff --git a/streaming/jellyfin/middleware.yaml b/streaming/jellyfin/middleware.yaml new file mode 100644 index 0000000..6737e74 --- /dev/null +++ b/streaming/jellyfin/middleware.yaml @@ -0,0 +1,9 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: metrics-blocker + namespace: streaming +spec: + replacePathRegex: + regex: ^/metrics + replacement: / diff --git a/streaming/jellyfin/pvc.yaml b/streaming/jellyfin/pvc.yaml new file mode 100644 index 0000000..1c102d7 --- /dev/null +++ b/streaming/jellyfin/pvc.yaml @@ -0,0 +1,49 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-pvc + namespace: streaming +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: flat-storage-class + +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: nfs-shows + namespace: streaming +spec: + storageClassName: "" + capacity: + storage: 1Gi + accessModes: + - ReadWriteMany + persistentVolumeReclaimPolicy: + mountOptions: + - hard + - nfsvers=4.1 + nfs: + path: /mnt/Alpha/Beta + server: 10.10.0.18 + readOnly: false + +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-shows + namespace: streaming +spec: + accessModes: + - ReadWriteMany + resources: + requests: + storage: 1Gi + storageClassName: "" + volumeName: nfs-shows + volumeMode: Filesystem diff --git a/streaming/jellyfin/service.yaml b/streaming/jellyfin/service.yaml new file mode 100644 index 0000000..088b29a --- /dev/null +++ b/streaming/jellyfin/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: jellyfin-svc + namespace: streaming +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 8096 + selector: + app: jellyfin diff --git a/streaming/jellyfin/traefik-ingress.yaml b/streaming/jellyfin/traefik-ingress.yaml new file mode 100644 index 0000000..4eb625b --- /dev/null +++ b/streaming/jellyfin/traefik-ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: traefik.containo.us/v1alpha1 +kind: IngressRoute +metadata: + name: traefik-ingress + namespace: streaming +spec: + entryPoints: + - websecure + routes: + - match: Host(`stream.beta.halia.dev`) && PathPrefix(`/`) + middlewares: + - name: metrics-blocker + kind: Rule + services: + - name: jellyfin-svc + port: 80 diff --git a/streaming/jellyseerr/deployment.yaml b/streaming/jellyseerr/deployment.yaml new file mode 100644 index 0000000..c8bab72 --- /dev/null +++ b/streaming/jellyseerr/deployment.yaml @@ -0,0 +1,44 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: jellyseerr + namespace: streaming +spec: + replicas: 1 + selector: + matchLabels: + app: jellyseerr + template: + metadata: + labels: + app: jellyseerr + spec: + hostname: jellyseerr + subdomain: jellyseerr + containers: + - name: jellyseerr + image: fallenbagel/jellyseerr:latest + lifecycle: + postStart: + exec: + command: + ['/bin/sh', '-c', + 'mkdir -p /app/config && + cp /app/config/settings.template.json /app/config/settings.json + '] + ports: + - containerPort: 5055 + env: + - name: TZ + value: "Europe/Copenhagen" + - name: LOG_LEVEL + value: "debug" + volumeMounts: + - name: jellyseer-config-volume + mountPath: /app/config/settings.template.json + subPath: settings.template.json + volumes: + - name: jellyseer-config-volume + configMap: + defaultMode: 420 + name: jellyseer-config diff --git a/streaming/jellyseerr/ingress.yaml b/streaming/jellyseerr/ingress.yaml new file mode 100644 index 0000000..848d820 --- /dev/null +++ b/streaming/jellyseerr/ingress.yaml @@ -0,0 +1,23 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: jellyseerr-ingress + namespace: streaming + annotations: + kubernetes.io/ingress.class: "traefik" +spec: + tls: + - secretName: jellyseerr-beta-tls + hosts: + - request.beta.halia.dev + rules: + - host: request.beta.halia.dev + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: jellyseerr-svc + port: + number: 80 diff --git a/streaming/jellyseerr/kustomization.yaml b/streaming/jellyseerr/kustomization.yaml new file mode 100644 index 0000000..c1e88c1 --- /dev/null +++ b/streaming/jellyseerr/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - service.yaml + - ingress.yaml + - configmap.yaml + - deployment.yaml diff --git a/streaming/jellyseerr/service.yaml b/streaming/jellyseerr/service.yaml new file mode 100644 index 0000000..b6dd40f --- /dev/null +++ b/streaming/jellyseerr/service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + name: jellyseerr-svc + namespace: streaming +spec: + ports: + - name: http + port: 80 + protocol: TCP + targetPort: 5055 + selector: + app: jellyseerr diff --git a/streaming/kustomization.yaml b/streaming/kustomization.yaml new file mode 100644 index 0000000..dd0cd9c --- /dev/null +++ b/streaming/kustomization.yaml @@ -0,0 +1,7 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - ./jellyfin + - ./jellyseerr diff --git a/streaming/namespace.yaml b/streaming/namespace.yaml new file mode 100644 index 0000000..fc53997 --- /dev/null +++ b/streaming/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: streaming