This commit is contained in:
Ariel Sosnovsky committed 2023-12-27 16:16:41 -05:00
1 parent d0575b552d
commit 73fe5f5d51
1 file changed
+139
@@ -0,0 +1,139 @@
---
apiVersion: v1
kind: ConfigMap
metadata:
name: jellyfin-envs
data:
PUID: "1000"
PGID: "1000"
TZ: {{ .Values.global.timezone }}
JELLYFIN_PublishedServerUrl: "https://jellyfin.{{ .Values.global.domain }}"
DOTNET_SYSTEM_IO_DISABLEFILELOCKING: "1"
---
kind: Service
apiVersion: v1
metadata:
name: jellyfin
spec:
selector:
app: jellyfin
type: ClusterIP
ports:
- port: 8096
targetPort: 8096
name: "http"
- port: 8920
targetPort: 8920
name: "https"
- port: 7359
targetPort: 7359
name: "7359-udp"
protocol: UDP
- port: 1900
targetPort: 1900
name: "1900-udp"
protocol: UDP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: jellyfin
spec:
selector:
matchLabels:
app: jellyfin
replicas: 1
revisionHistoryLimit: 2
updateStrategy:
type: RollingUpdate
volumeClaimTemplates:
- metadata:
finalizers:
- kubernetes.io/pvc-protection
name: config
spec:
storageClassName: local-path
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
limits:
storage: 100Gi
- metadata:
finalizers:
- kubernetes.io/pvc-protection
name: cache
spec:
storageClassName: local-path
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
limits:
storage: 100Gi
template:
metadata:
labels:
app: jellyfin
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: homelab/capacity
operator: In
values:
- high
containers:
- name: jellyfin
image: "{{ .Values.jellyfin.repo }}:{{ .Values.jellyfin.tag }}"
imagePullPolicy: "Always"
envFrom:
- configMapRef:
name: jellyfin-envs
ports:
- containerPort: 8096
name: jellyfin
- containerPort: 8920
- containerPort: 7359
protocol: UDP
- containerPort: 1900
protocol: UDP
resources:
{{- .Values.jellyfin.resources | toYaml | nindent 12 }}
volumeMounts:
- name: config
mountPath: /config
- name: cache
mountPath: /cache
- name: torrents
mountPath: /data/tv
subPath: tv
- name: torrents
mountPath: /data/movies
subPath: movies
- name: family-videos
mountPath: /data/family-videos
startupProbe:
tcpSocket:
port: jellyfin
initialDelaySeconds: 10
failureThreshold: 10
timeoutSeconds: 30
volumes:
- name: torrents
nfs:
server: "{{ $.Values.global.nfs.server }}"
path: "{{ $.Values.global.nfs.additionalShares.torrents }}"
readOnly: true
- name: family-videos
nfs:
server: "{{ $.Values.global.nfs.server }}"
path: "{{ .Values.global.nfs.additionalShares.familyvideos }}"
readOnly: true