Skip to content

Commit

Permalink
feat(charts): Add Jellyfin
Browse files Browse the repository at this point in the history
  • Loading branch information
umbertix committed Jan 29, 2024
1 parent 89862e1 commit 2c96b41
Show file tree
Hide file tree
Showing 10 changed files with 735 additions and 414 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ jobs:
- name: Edit hosts file and test apps
run: |
sudo echo "127.0.0.1 ${{ env.plex_ingress_host }} ${{ env.ingress_host }}" | sudo tee -a /etc/hosts
wget ${{ env.ingress_host }}/sonarr
wget ${{ env.ingress_host }}/radarr
wget ${{ env.ingress_host }}/sabnzbd
wget ${{ env.ingress_host }}/prowlarr
wget --retry-on-http-error=503,500 ${{ env.ingress_host }}/jackett
sudo echo "127.0.0.1 ${{ env.jellyfin_ingress_host }} ${{ env.ingress_host }}" | sudo tee -a /etc/hosts
wget --retry-on-http-error=503,500 ${{ env.ingress_host }}/sonarr
wget --retry-on-http-error=503,500 ${{ env.ingress_host }}/radarr
wget --retry-on-http-error=503,500 ${{ env.ingress_host }}/sabnzbd
wget --retry-on-http-error=503,500 ${{ env.ingress_host }}/prowlarr
wget --retry-on-http-error=503,500 ${{ env.ingress_host }}/jackett
curl ${{ env.plex_ingress_host }}
curl ${{ env.jellyfin_ingress_host }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ bin
*.swo
*~
kubeserver.yml
my-values.yaml
372 changes: 206 additions & 166 deletions README.md

Large diffs are not rendered by default.

25 changes: 22 additions & 3 deletions config/samples/charts_v1_k8smediaserver.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ spec:
pgid: 1000
# Persistent storage selections and pathing
storage:
customVolume: false # set to true if not using a PVC (must provide volume below)
customVolume: false # set to true if not using a PVC (must provide volume below)
pvcName: mediaserver-pvc
size: 5Gi
pvcStorageClass: ""
Expand Down Expand Up @@ -73,6 +73,27 @@ spec:
port: 32400
type: ClusterIP
volume: {}
jellyfin:
container:
image: docker.io/linuxserver/jellyfin
nodeSelector: {}
port: 8096
enabled: false
ingress:
annotations: {}
enabled: true
tls:
enabled: false
secretName: ""
replicaCount: 1
resources: {}
service:
extraLBAnnotations: {}
extraLBService: false
nodePort: null
port: 8096
type: ClusterIP
volume: {}
prowlarr:
container:
image: docker.io/linuxserver/prowlarr
Expand Down Expand Up @@ -203,5 +224,3 @@ spec:
port: 9091
type: ClusterIP
volume: {}


4 changes: 2 additions & 2 deletions helm-charts/k8s-mediaserver/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
appVersion: 0.9.2
appVersion: 0.10.0
description: A Helm chart for Kubernetes mediaserver
name: k8s-mediaserver
type: application
version: 0.9.2
version: 0.10.0
157 changes: 157 additions & 0 deletions helm-charts/k8s-mediaserver/templates/jellyfin-resources.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,157 @@
{{ if .Values.jellyfin.enabled }}
---
### CONFIGMAP
apiVersion: v1
kind: ConfigMap
metadata:
name: jellyfin-config
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
---
### DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
metadata:
name: jellyfin
labels:
{{- include "k8s-mediaserver.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.jellyfin.replicaCount }}
selector:
matchLabels:
{{- include "k8s-mediaserver.selectorLabels" . | nindent 6 }}
template:
metadata:
labels:
{{- include "k8s-mediaserver.selectorLabels" . | nindent 8 }}
app: jellyfin
spec:
volumes:
{{- if not .Values.general.storage.customVolume }}
- name: mediaserver-volume
persistentVolumeClaim:
claimName: {{ .Values.general.storage.pvcName }}
{{- else }}
- name: mediaserver-volume
{{- toYaml .Values.general.storage.volumes | nindent 10 }}
{{- end }}
{{- if .Values.jellyfin.volume }}
- name: {{ .Values.jellyfin.volume.name }}
persistentVolumeClaim:
claimName: {{ .Values.jellyfin.volume.name }}
{{- end }}
containers:
- name: {{ .Chart.Name }}
envFrom:
- configMapRef:
name: jellyfin-config
image: "{{ .Values.jellyfin.container.image }}:{{ .Values.jellyfin.container.tag | default .Values.general.image_tag }}"
imagePullPolicy: Always
readinessProbe:
tcpSocket:
port: {{ .Values.jellyfin.container.port }}
initialDelaySeconds: 20
periodSeconds: 15
ports:
- name: jellyfin-port
containerPort: {{ .Values.jellyfin.container.port }}
protocol: TCP
volumeMounts:
{{- if .Values.jellyfin.volume }}
- name: {{ .Values.jellyfin.volume.name }}
mountPath: /config
{{- else }}
- name: mediaserver-volume
mountPath: /config
subPath: "{{ .Values.general.storage.subPaths.config }}/jellyfin"
{{- end }}
- name: mediaserver-volume
mountPath: /movies
subPath: "{{ .Values.general.storage.subPaths.movies }}"
- name: mediaserver-volume
mountPath: /tv
subPath: "{{ .Values.general.storage.subPaths.tv }}"
{{- with .Values.jellyfin.resources }}
resources:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.general.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
---
### SERVICE
apiVersion: v1
kind: Service
metadata:
name: jellyfin
labels:
{{- include "k8s-mediaserver.labels" . | nindent 4 }}
spec:
type: {{ .Values.jellyfin.service.type }}
ports:
- port: {{ .Values.jellyfin.service.port }}
targetPort: {{ .Values.jellyfin.container.port }}
protocol: TCP
name: jellyfin-port
{{ if eq .Values.jellyfin.service.type "NodePort" }}
nodePort: {{ .Values.jellyfin.service.nodePort }}
{{ end }}
selector:
app: jellyfin

---
{{ if .Values.jellyfin.service.extraLBService }}
apiVersion: v1
kind: Service
metadata:
name: jellyfin-lb
annotations:
{{- include .Values.jellyfin.service.extraLBService.annotations . | nindent 4 }}
labels:
{{- include "k8s-mediaserver.labels" . | nindent 4 }}
spec:
type: LoadBalancer
ports:
- port: {{ .Values.jellyfin.service.port }}
targetPort: {{ .Values.jellyfin.container.port }}
protocol: TCP
name: jellyfin-port
selector:
app: jellyfin
{{ end }}
---
### INGRESS
{{ if .Values.jellyfin.ingress.enabled }}
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: jellyfin
labels:
{{- include "k8s-mediaserver.labels" . | nindent 4 }}
{{- with .Values.jellyfin.ingress.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.jellyfin.ingress.tls.enabled }}
tls:
- hosts:
- {{ .Values.general.jellyfin_ingress_host | quote }}
secretName: {{ .Values.jellyfin.ingress.tls.secretName }}
{{ end }}
ingressClassName: {{ .Values.general.ingress.ingressClassName }}
rules:
- host: {{ .Values.general.jellyfin_ingress_host | quote }}
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: jellyfin
port:
number: {{ .Values.jellyfin.service.port }}
{{ end }}
{{ end }}
26 changes: 26 additions & 0 deletions helm-charts/k8s-mediaserver/templates/storage-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,32 @@ spec:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- with .Values.jellyfin.volume }}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .name }}
{{ with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{ with .labels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
- {{ .accessModes }}
resources:
requests:
storage: {{ .storage }}
storageClassName: {{ .storageClassName }}
{{ with .selector }}
selector:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
{{- with .Values.jackett.volume }}
---
apiVersion: v1
Expand Down
74 changes: 55 additions & 19 deletions helm-charts/k8s-mediaserver/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
general:
ingress_host: k8s-mediaserver.k8s.test
plex_ingress_host: k8s-plex.k8s.test
jellyfin_ingress_host: k8s-jelly.k8s.test
image_tag: latest
podDistribution: cluster # can be "spread" or "cluster"
#UID to run the process with
puid: 1000
#GID to run the process with
# GID to run the process with
pgid: 1000
#Persistent storage selections and pathing
# Persistent storage selections and pathing
storage:
customVolume: false #set to true if not using a PVC (must provide volume below)
customVolume: false # set to true if not using a PVC (must provide volume below)
pvcName: mediaserver-pvc
accessMode: ""
size: 5Gi
Expand Down Expand Up @@ -55,15 +56,15 @@ sonarr:
secretName: ""
resources: {}
volume: {}
#name: pvc-sonarr-config
#storageClassName: longhorn
#annotations:
# my-annotation/test: my-value
#labels:
# my-label/test: my-other-value
#accessModes: ReadWriteOnce
#storage: 5Gi
#selector: {}
# name: pvc-sonarr-config
# storageClassName: longhorn
# annotations:
# my-annotation/test: my-value
# labels:
# my-label/test: my-other-value
# accessModes: ReadWriteOnce
# storage: 5Gi
# selector: {}

radarr:
enabled: true
Expand All @@ -87,13 +88,13 @@ radarr:
secretName: ""
resources: {}
volume: {}
#name: pvc-radarr-config
#storageClassName: longhorn
#annotations: {}
#labels: {}
#accessModes: ReadWriteOnce
#storage: 5Gi
#selector: {}
# name: pvc-radarr-config
# storageClassName: longhorn
# annotations: {}
# labels: {}
# accessModes: ReadWriteOnce
# storage: 5Gi
# selector: {}

jackett:
enabled: true
Expand Down Expand Up @@ -279,3 +280,38 @@ plex:
# accessModes: ReadWriteOnce
# storage: 5Gi
# selector: {}

jellyfin:
enabled: false
replicaCount: 1
container:
image: docker.io/linuxserver/jellyfin
nodeSelector: {}
port: 8096
service:
type: ClusterIP
port: 8096
nodePort:
# Defines an additional LB service, requires cloud provider service or MetalLB
extraLBService: false
ingress:
enabled: true
annotations: {}
tls:
enabled: false
secretName: ""
resources: {}
# limits:
# cpu: 100m
# memory: 100Mi
# requests:
# cpu: 100m
# memory: 100Mi
volume: {}
# name: pvc-jellyfin-config
# storageClassName: longhorn
# annotations: {}
# labels: {}
# accessModes: ReadWriteOnce
# storage: 5Gi
# selector: {}
Loading

0 comments on commit 2c96b41

Please sign in to comment.