From d07ec7982100e614bd2cc3b1e4eb36d113a18247 Mon Sep 17 00:00:00 2001 From: Paul Payne Date: Tue, 27 May 2025 17:19:51 -0700 Subject: [PATCH] Add Jellyfin application configuration and deployment files --- apps/jellyfin/config/example.env | 12 +++++ apps/jellyfin/deployment.yaml | 49 +++++++++++++++++++ apps/jellyfin/ingress.yaml | 24 ++++++++++ apps/jellyfin/kustomization.yaml | 82 ++++++++++++++++++++++++++++++++ apps/jellyfin/namespace.yaml | 5 ++ apps/jellyfin/pvc.yaml | 37 ++++++++++++++ apps/jellyfin/service.yaml | 15 ++++++ 7 files changed, 224 insertions(+) create mode 100644 apps/jellyfin/config/example.env create mode 100644 apps/jellyfin/deployment.yaml create mode 100644 apps/jellyfin/ingress.yaml create mode 100644 apps/jellyfin/kustomization.yaml create mode 100644 apps/jellyfin/namespace.yaml create mode 100644 apps/jellyfin/pvc.yaml create mode 100644 apps/jellyfin/service.yaml diff --git a/apps/jellyfin/config/example.env b/apps/jellyfin/config/example.env new file mode 100644 index 0000000..b1af30b --- /dev/null +++ b/apps/jellyfin/config/example.env @@ -0,0 +1,12 @@ +# Config +JELLYFIN_DOMAIN=jellyfin.$DOMAIN +JELLYFIN_CONFIG_STORAGE=1Gi +JELLYFIN_CACHE_STORAGE=10Gi +JELLYFIN_MEDIA_STORAGE=100Gi +TZ=UTC + +# Docker Images +JELLYFIN_IMAGE=jellyfin/jellyfin:latest + +# Jellyfin Configuration +JELLYFIN_PublishedServerUrl=https://jellyfin.$DOMAIN \ No newline at end of file diff --git a/apps/jellyfin/deployment.yaml b/apps/jellyfin/deployment.yaml new file mode 100644 index 0000000..a88eb03 --- /dev/null +++ b/apps/jellyfin/deployment.yaml @@ -0,0 +1,49 @@ +--- +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 \ No newline at end of file diff --git a/apps/jellyfin/ingress.yaml b/apps/jellyfin/ingress.yaml new file mode 100644 index 0000000..3fd9b84 --- /dev/null +++ b/apps/jellyfin/ingress.yaml @@ -0,0 +1,24 @@ +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: jellyfin-public + annotations: + external-dns.alpha.kubernetes.io/target: your.jellyfin.domain + external-dns.alpha.kubernetes.io/cloudflare-proxied: "false" +spec: + rules: + - host: your.jellyfin.domain + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: jellyfin + port: + number: 8096 + tls: + - secretName: wildcard-internal-sovereign-cloud-tls + hosts: + - your.jellyfin.domain \ No newline at end of file diff --git a/apps/jellyfin/kustomization.yaml b/apps/jellyfin/kustomization.yaml new file mode 100644 index 0000000..63d9cfb --- /dev/null +++ b/apps/jellyfin/kustomization.yaml @@ -0,0 +1,82 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: jellyfin +labels: + - includeSelectors: true + pairs: + app: jellyfin + managedBy: kustomize + partOf: sovereign-cloud +resources: + - deployment.yaml + - ingress.yaml + - namespace.yaml + - pvc.yaml + - service.yaml +configMapGenerator: + - name: config + envs: + - config/config.env + +replacements: + - source: + kind: ConfigMap + name: config + fieldPath: data.DOMAIN + targets: + - select: + kind: Ingress + name: jellyfin-public + fieldPaths: + - metadata.annotations.[external-dns.alpha.kubernetes.io/target] + - source: + kind: ConfigMap + name: config + fieldPath: data.JELLYFIN_DOMAIN + targets: + - select: + kind: Ingress + name: jellyfin-public + fieldPaths: + - spec.rules.0.host + - spec.tls.0.hosts.0 + - source: + kind: ConfigMap + name: config + fieldPath: data.JELLYFIN_CONFIG_STORAGE + targets: + - select: + kind: PersistentVolumeClaim + name: jellyfin-config-pvc + fieldPaths: + - spec.resources.requests.storage + - source: + kind: ConfigMap + name: config + fieldPath: data.JELLYFIN_CACHE_STORAGE + targets: + - select: + kind: PersistentVolumeClaim + name: jellyfin-cache-pvc + fieldPaths: + - spec.resources.requests.storage + - source: + kind: ConfigMap + name: config + fieldPath: data.JELLYFIN_MEDIA_STORAGE + targets: + - select: + kind: PersistentVolumeClaim + name: jellyfin-media-pvc + fieldPaths: + - spec.resources.requests.storage + - source: + kind: ConfigMap + name: config + fieldPath: data.JELLYFIN_IMAGE + targets: + - select: + kind: Deployment + name: jellyfin + fieldPaths: + - spec.template.spec.containers.0.image \ No newline at end of file diff --git a/apps/jellyfin/namespace.yaml b/apps/jellyfin/namespace.yaml new file mode 100644 index 0000000..a02d3bc --- /dev/null +++ b/apps/jellyfin/namespace.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: v1 +kind: Namespace +metadata: + name: jellyfin \ No newline at end of file diff --git a/apps/jellyfin/pvc.yaml b/apps/jellyfin/pvc.yaml new file mode 100644 index 0000000..d6a5e9f --- /dev/null +++ b/apps/jellyfin/pvc.yaml @@ -0,0 +1,37 @@ +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-config-pvc + namespace: jellyfin +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-cache-pvc + namespace: jellyfin +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 10Gi +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-media-pvc + namespace: jellyfin +spec: + accessModes: + - ReadWriteMany + storageClassName: nfs + resources: + requests: + storage: 100Gi \ No newline at end of file diff --git a/apps/jellyfin/service.yaml b/apps/jellyfin/service.yaml new file mode 100644 index 0000000..87817ac --- /dev/null +++ b/apps/jellyfin/service.yaml @@ -0,0 +1,15 @@ +--- +apiVersion: v1 +kind: Service +metadata: + name: jellyfin + namespace: jellyfin + labels: + app: jellyfin +spec: + ports: + - port: 8096 + targetPort: 8096 + protocol: TCP + selector: + app: jellyfin \ No newline at end of file