diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e69de29 diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..9cd826c --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "cSpell.words": [ + "jellyfin", + "tvshows" + ] +} \ No newline at end of file diff --git a/deploy/app/deployment.yaml b/deploy/app/deployment.yaml new file mode 100644 index 0000000..ad25f9a --- /dev/null +++ b/deploy/app/deployment.yaml @@ -0,0 +1,47 @@ +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 + ports: + - containerPort: 7359 + - containerPort: 8096 + volumeMounts: + - name: cache + mountPath: /cache + - name: config + mountPath: /config + - name: music + mountPath: /music + - name: tv-shows + mountPath: /tv-shows + - name: movies + mountPath: /movies + volumes: + - name: config + persistentVolumeClaim: + claimName: jellyfin-config + - name: cache + persistentVolumeClaim: + claimName: jellyfin-cache + - name: music + persistentVolumeClaim: + claimName: jellyfin-music + - name: tv-shows + persistentVolumeClaim: + claimName: jellyfin-tv-shows + - name: movies + persistentVolumeClaim: + claimName: jellyfin-movies \ No newline at end of file diff --git a/deploy/app/ingress.yaml b/deploy/app/ingress.yaml new file mode 100644 index 0000000..7b7ce74 --- /dev/null +++ b/deploy/app/ingress.yaml @@ -0,0 +1,18 @@ +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: jellyfin +spec: + entryPoints: + - websecure + routes: + - match: Host(`media.casa.limbosolutions.com`) + kind: Rule + services: + # - name: jellyfin + # port: 7359 + - name: jellyfin + port: 8096 + tls: + secretName: casa-limbosolutions-com-tls + diff --git a/deploy/app/kustomization.yaml b/deploy/app/kustomization.yaml new file mode 100644 index 0000000..93f6f91 --- /dev/null +++ b/deploy/app/kustomization.yaml @@ -0,0 +1,11 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +namespace: jellyfin +resources: + - deployment.yaml + - service.yaml + - ingress.yaml + - volumes.music.yaml + - volumes.tv-shows.yaml + - volumes.movies.yaml + - volumes.app-data.yaml diff --git a/deploy/app/service.yaml b/deploy/app/service.yaml new file mode 100644 index 0000000..5eb3993 --- /dev/null +++ b/deploy/app/service.yaml @@ -0,0 +1,17 @@ +apiVersion: v1 +kind: Service +metadata: + name: jellyfin +spec: + selector: + app: jellyfin + ports: + - name: udp + protocol: UDP + port: 7359 + targetPort: 7359 + - name: web + protocol: TCP + port: 8096 + targetPort: 8096 + type: ClusterIP \ No newline at end of file diff --git a/deploy/app/volumes.app-data.yaml b/deploy/app/volumes.app-data.yaml new file mode 100644 index 0000000..2ea36ab --- /dev/null +++ b/deploy/app/volumes.app-data.yaml @@ -0,0 +1,25 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-cache +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 4Gi + storageClassName: local-path + +--- + +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-config +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi + storageClassName: local-path \ No newline at end of file diff --git a/deploy/app/volumes.movies.yaml b/deploy/app/volumes.movies.yaml new file mode 100644 index 0000000..0a05b6a --- /dev/null +++ b/deploy/app/volumes.movies.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-movies +spec: + storageClassName: storage-limbosolutions-com + volumeName: jellyfin-movies + accessModes: + - ReadOnlyMany + resources: + requests: + storage: 128Gi + +--- + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: jellyfin-movies +spec: + storageClassName: storage-limbosolutions-com + accessModes: + - ReadOnlyMany + capacity: + storage: 128Gi + csi: + driver: storage-limbosolutions-com-csi-driver + volumeHandle: jellyfin-movies + volumeAttributes: + collection: media.videos + path: /buckets/media.videos/movies + volumeServerAccess: filerProxy + persistentVolumeReclaimPolicy: Retain + volumeMode: Filesystem \ No newline at end of file diff --git a/deploy/app/volumes.music.yaml b/deploy/app/volumes.music.yaml new file mode 100644 index 0000000..66b6a17 --- /dev/null +++ b/deploy/app/volumes.music.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-music +spec: + storageClassName: storage-limbosolutions-com + volumeName: jellyfin-music + accessModes: + - ReadOnlyMany + resources: + requests: + storage: 128Gi + +--- + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: jellyfin-music +spec: + storageClassName: storage-limbosolutions-com + accessModes: + - ReadOnlyMany + capacity: + storage: 128Gi + csi: + driver: storage-limbosolutions-com-csi-driver + volumeHandle: jellyfin-music + volumeAttributes: + collection: media.music + path: /buckets/media.music + volumeServerAccess: filerProxy + persistentVolumeReclaimPolicy: Retain + volumeMode: Filesystem \ No newline at end of file diff --git a/deploy/app/volumes.tv-shows.yaml b/deploy/app/volumes.tv-shows.yaml new file mode 100644 index 0000000..4bddacc --- /dev/null +++ b/deploy/app/volumes.tv-shows.yaml @@ -0,0 +1,34 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: jellyfin-tv-shows +spec: + storageClassName: storage-limbosolutions-com + volumeName: jellyfin-tv-shows + accessModes: + - ReadOnlyMany + resources: + requests: + storage: 128Gi + +--- + +apiVersion: v1 +kind: PersistentVolume +metadata: + name: jellyfin-tv-shows +spec: + storageClassName: storage-limbosolutions-com + accessModes: + - ReadOnlyMany + capacity: + storage: 128Gi + csi: + driver: storage-limbosolutions-com-csi-driver + volumeHandle: jellyfin-tv-shows + volumeAttributes: + collection: media.videos + path: /buckets/media.videos/tvshows + volumeServerAccess: filerProxy + persistentVolumeReclaimPolicy: Retain + volumeMode: Filesystem \ No newline at end of file diff --git a/deploy/flux/.env.d/.gitignore b/deploy/flux/.env.d/.gitignore new file mode 100644 index 0000000..d29675e --- /dev/null +++ b/deploy/flux/.env.d/.gitignore @@ -0,0 +1,2 @@ +** +!.gitignore \ No newline at end of file diff --git a/deploy/flux/app-sync.yaml b/deploy/flux/app-sync.yaml new file mode 100644 index 0000000..e46c7c9 --- /dev/null +++ b/deploy/flux/app-sync.yaml @@ -0,0 +1,13 @@ +apiVersion: kustomize.toolkit.fluxcd.io/v1 +kind: Kustomization +metadata: + name: jellyfin +spec: + interval: 1m + sourceRef: + kind: GitRepository + name: lms + path: deploy/app + prune: true + suspend: false + \ No newline at end of file diff --git a/deploy/flux/git-repo.yaml b/deploy/flux/git-repo.yaml new file mode 100644 index 0000000..46c1d4e --- /dev/null +++ b/deploy/flux/git-repo.yaml @@ -0,0 +1,11 @@ +apiVersion: source.toolkit.fluxcd.io/v1 +kind: GitRepository +metadata: + name: jellyfin +spec: + interval: 1m0s + url: ssh://git@git.limbosolutions.com:2222/myLimbo.jellyfin + ref: + branch: main + secretRef: + name: flux-repo-ssh-credentials \ No newline at end of file diff --git a/deploy/flux/kustomization.yaml b/deploy/flux/kustomization.yaml new file mode 100644 index 0000000..41277f5 --- /dev/null +++ b/deploy/flux/kustomization.yaml @@ -0,0 +1,14 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - git-repo.yaml + - app-sync.yaml +secretGenerator: + - name: flux-repo-ssh-credentials + namespace: lyrionmusicserver + files: + - "identity=./.env.d/flux-repo-ssh-key" + - "known_hosts=./.env.d/flux-repo-ssh-known_hosts" + - "pubkey=./.env.d/flux-repo-ssh-key.pub" + - name: flux-sops-age + namespace: jellyfin