Skip to content

Commit

Permalink
add optimizations for plex
Browse files Browse the repository at this point in the history
Signed-off-by: Bernard Gütermann <[email protected]>
  • Loading branch information
bernardgut committed Sep 21, 2024
1 parent f715b5c commit ad890d4
Show file tree
Hide file tree
Showing 8 changed files with 84 additions and 81 deletions.
4 changes: 2 additions & 2 deletions charts/k8s-mediamanager/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: k8s-mediamanager
description: Kubernetes media manager helm chart based on onedr0p rootless images
type: application
version: 1.2.2
appVersion: "1.2.2"
version: 1.2.3
appVersion: "1.2.3"
19 changes: 7 additions & 12 deletions charts/k8s-mediamanager/templates/lidarr/lidarr-resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ kind: ConfigMap
metadata:
name: init-lidarr-cm
---
## APPLICATION
apiVersion: v1
kind: ConfigMap
metadata:
name: lidarr-config
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
---
### DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -149,9 +140,13 @@ spec:
capabilities:
drop:
- ALL
envFrom:
- configMapRef:
name: lidarr-config
env:
- name: PUID
value: "{{ .Values.general.puid }}"
- name: PGID
value: "{{ .Values.general.pgid }}"
- name: TZ
value: "{{ .Values.general.timezone }}"
image: "{{ .Values.lidarr.container.image }}:{{ .Values.lidarr.container.tag }}"
imagePullPolicy: Always
livenessProbe:
Expand Down
68 changes: 41 additions & 27 deletions charts/k8s-mediamanager/templates/plex/plex-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,6 @@ spec:
{{- end }}
{{- end }}
---
### PLEX
### CONFIGMAP
apiVersion: v1
kind: ConfigMap
metadata:
name: plex-config
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
PLEX_CLAIM: {{ .Values.plex.claim }}
---
### TAUTULLI
### INIT-CONTAINER
apiVersion: v1
Expand All @@ -87,15 +76,6 @@ data:
echo "### No configuration found, intialized with default settings ###"
fi
---
### CONFIGMAP
apiVersion: v1
kind: ConfigMap
metadata:
name: tautulli-config
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
---
### DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -141,7 +121,6 @@ spec:
{{- if .Values.plex.extraVolumes }}
{{- toYaml .Values.plex.extraVolumes | nindent 8}}
{{- end }}
hostNetwork: {{ .Values.plex.hostNetwork }}
initContainers:
- name: tautuli-config
image: docker.io/ubuntu:groovy
Expand Down Expand Up @@ -170,9 +149,13 @@ spec:
"--datadir", "/config",
"--port", {{ .Values.plex.tautulli.container.port | quote }}
]
envFrom:
- configMapRef:
name: tautulli-config
env:
- name: PUID
value: "{{ .Values.general.puid }}"
- name: PGID
value: "{{ .Values.general.pgid }}"
- name: TZ
value: "{{ .Values.general.timezone }}"
image: "{{ .Values.plex.tautulli.container.image }}:{{ .Values.plex.tautulli.container.tag }}"
imagePullPolicy: IfNotPresent
livenessProbe:
Expand Down Expand Up @@ -203,9 +186,13 @@ spec:
capabilities:
drop:
- ALL
envFrom:
- configMapRef:
name: plex-config
environment:
- name: PUID
value: "{{ .Values.general.puid }}"
- name: PGID
value: "{{ .Values.general.pgid }}"
- name: PLEX_CLAIM
value: {{ .Values.plex.claim }}
image: "{{ .Values.plex.container.image }}:{{ .Values.plex.container.tag }}"
imagePullPolicy: IfNotPresent
livenessProbe:
Expand All @@ -222,6 +209,30 @@ spec:
- name: plex-port
containerPort: {{ .Values.plex.container.port }}
protocol: TCP
- name: dlna-server
containerPort: 1900
protocol: UDP
- name: dlna-http
containerPort: 32469
protocol: TCP
- name: bonjour
containerPort: 5353
protocol: UDP
- name: plex-companion
containerPort: 8324
protocol: TCP
- name: gdm-32410
containerPort: 32410
protocol: UDP
- name: gdm-32412
containerPort: 32412
protocol: UDP
- name: gdm-32413
containerPort: 32413
protocol: UDP
- name: gdm-32414
containerPort: 32414
protocol: UDP
volumeMounts:
- name: plex-config
mountPath: /config
Expand All @@ -231,6 +242,9 @@ spec:
- name: media
mountPath: /tv
subPath: "{{ .Values.general.sharedStorage.subPaths.tv }}"
- name: media
mountPath: /music
subPath: "{{ .Values.general.sharedStorage.subPaths.music }}"
{{- if .Values.plex.extraVolumeMounts }}
{{- toYaml .Values.plex.extraVolumeMounts | nindent 12}}
{{- end }}
Expand Down
19 changes: 7 additions & 12 deletions charts/k8s-mediamanager/templates/prowlarr/prowlarr-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ kind: ConfigMap
metadata:
name: init-prowlarr-cm
---
## APPLICATION
apiVersion: v1
kind: ConfigMap
metadata:
name: prowlarr-config
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
---
### DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -149,9 +140,13 @@ spec:
capabilities:
drop:
- ALL
envFrom:
- configMapRef:
name: prowlarr-config
env:
- name: PUID
value: "{{ .Values.general.puid }}"
- name: PGID
value: "{{ .Values.general.pgid }}"
- name: TZ
value: "{{ .Values.general.timezone }}"
image: "{{ .Values.prowlarr.container.image }}:{{ .Values.prowlarr.container.tag }}"
imagePullPolicy: Always
livenessProbe:
Expand Down
19 changes: 7 additions & 12 deletions charts/k8s-mediamanager/templates/radarr/radarr-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ kind: ConfigMap
metadata:
name: init-radarr-cm
---
## APPLICATION
apiVersion: v1
kind: ConfigMap
metadata:
name: radarr-config
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
---
### DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -151,9 +142,13 @@ spec:
capabilities:
drop:
- ALL
envFrom:
- configMapRef:
name: radarr-config
env:
- name: PUID
value: "{{ .Values.general.puid }}"
- name: PGID
value: "{{ .Values.general.pgid }}"
- name: TZ
value: "{{ .Values.general.timezone }}"
image: "{{ .Values.radarr.container.image }}:{{ .Values.radarr.container.tag }}"
imagePullPolicy: Always
livenessProbe:
Expand Down
23 changes: 9 additions & 14 deletions charts/k8s-mediamanager/templates/sonarr/sonarr-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,6 @@ kind: ConfigMap
metadata:
name: init-sonarr-cm
---
## APPLICATION
apiVersion: v1
kind: ConfigMap
metadata:
name: sonarr-config
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
---
### DEPLOYMENT
apiVersion: apps/v1
kind: Deployment
Expand Down Expand Up @@ -150,21 +141,25 @@ spec:
capabilities:
drop:
- ALL
envFrom:
- configMapRef:
name: sonarr-config
env:
- name: PUID
value: "{{ .Values.general.puid }}"
- name: PGID
value: "{{ .Values.general.pgid }}"
- name: TZ
value: "{{ .Values.general.timezone }}"
image: "{{ .Values.sonarr.container.image }}:{{ .Values.sonarr.container.tag }}"
imagePullPolicy: Always
livenessProbe:
httpGet:
path: {{ .Values.sonarr.ingress.path }}
port: {{ .Values.sonarr.container.port }}
initialDelaySeconds: 10
initialDelaySeconds: 15
readinessProbe:
httpGet:
path: {{ .Values.sonarr.ingress.path }}
port: {{ .Values.sonarr.container.port }}
initialDelaySeconds: 10
initialDelaySeconds: 15
ports:
- name: sonarr-port
containerPort: {{ .Values.sonarr.container.port }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ metadata:
data:
PGID: "{{ .Values.general.pgid }}"
PUID: "{{ .Values.general.puid }}"
TZ: "{{ .Values.general.timezone }}"
TRANSMISSION__DOWNLOAD_DIR: "/downloads/complete"
TRANSMISSION__INCOMPLETE_DIR: "/downloads/transmission/incomplete"
TRANSMISSION__PEER_PORT: "{{ .Values.transmission.service.peer.port }}"
Expand Down
12 changes: 10 additions & 2 deletions charts/k8s-mediamanager/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ general:
puid: 1000
#GID to run the process with
pgid: 1000
# timezone for the services
timezone: "Etc/UTC"
# IP family policy for services [ 'SingleStack', 'PreferDualStack', 'RequireDualStack' ]
ipFamilyPolicy: PreferDualStack
# IP families for services : you can manualy specify the IP families you want to use for your services ['IPv4', 'IPv6']
Expand Down Expand Up @@ -47,7 +49,6 @@ general:
plex:
enabled: true
claim: "CHANGEME"
hostNetwork: false # Will sometimes be needed for upnp forwarding
replicaCount: 1
container:
image: ghcr.io/onedr0p/plex
Expand All @@ -69,15 +70,22 @@ plex:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "2"
#cpu: "2"
memory: "4Gi"
volume:
name: plex-config
accessModes: "ReadWriteOnce"
storage: "1Gi"
storageClassName: ""
# We mount a memory volume to /transcode to speed up transcoding and save wear on the disk
extraVolumes: {}
# - name: plex-transcode
# emptyDir:
# medium: Memory
# sizeLimit: "16Gi"
extraVolumeMounts: {}
# - name: plex-transcode
# mountPath: /transcode
tautulli:
enabled: true
container:
Expand Down

0 comments on commit ad890d4

Please sign in to comment.