From e691c05c27c3add62d5e3a28b3615b62bd65064b Mon Sep 17 00:00:00 2001 From: Felix Mumme Date: Mon, 13 Jan 2025 01:04:42 +0100 Subject: [PATCH] add existingclaim option to plex --- README.md | 29 ++++++++++++++++++++++++++--- plex/templates/deployment.yaml | 8 ++++++++ plex/templates/pvc.yaml | 4 ++-- plex/values.yaml | 7 +++++++ 4 files changed, 43 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a8d6a8e..a600105 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,29 @@ persistence: existingClaim: "qbittorrent-downloads" # Use the PVC created by qBittorrent ``` +3. For Plex, you can reuse existing storage for all volume types: +```yaml +# plex/values.yaml +persistence: + # Use existing PVC for configuration + config: + enabled: true + existingClaim: "plex-config" # Optional: reuse existing config PVC + # Use existing PVC for transcoding + transcode: + enabled: true + existingClaim: "plex-transcode" # Optional: reuse existing transcode PVC + # Use existing PVC for media + data: + enabled: true + existingClaim: "media-storage" # Optional: reuse existing media PVC +``` + +This allows you to: +- Preserve Plex configuration across reinstalls +- Share transcode space between multiple Plex instances +- Mount existing media libraries + #### Setting Up Ingress Each service can be exposed using Kubernetes ingress. Here's a detailed example: @@ -291,8 +314,8 @@ You can serve these charts from your own server. The repository structure is ava ### Adding the Repository to Helm ```bash -# Add the repository (using Gitea raw access) -helm repo add media-charts https://git.mumme-it.de/Felix/media-charts/raw/branch/main/.packaged +# Add the repository +helm repo add media-charts https://git.mumme-it.de/Mumme-IT/media-charts/raw/branch/main/.packaged # Update the repository cache helm repo update @@ -304,7 +327,7 @@ helm search repo media-charts ### Repository Source The source code for these charts is available at: -https://git.mumme-it.de/Felix/media-charts +https://git.mumme-it.de/Mumme-IT/media-charts ### Installing Charts from Repository diff --git a/plex/templates/deployment.yaml b/plex/templates/deployment.yaml index 7bd3ef3..504a308 100644 --- a/plex/templates/deployment.yaml +++ b/plex/templates/deployment.yaml @@ -83,14 +83,22 @@ spec: - name: config {{- if .Values.persistence.config.enabled }} persistentVolumeClaim: + {{- if .Values.persistence.config.existingClaim }} + claimName: {{ .Values.persistence.config.existingClaim }} + {{- else }} claimName: {{ include "plex.fullname" . }}-config + {{- end }} {{- else }} emptyDir: {} {{- end }} - name: transcode {{- if .Values.persistence.transcode.enabled }} persistentVolumeClaim: + {{- if .Values.persistence.transcode.existingClaim }} + claimName: {{ .Values.persistence.transcode.existingClaim }} + {{- else }} claimName: {{ include "plex.fullname" . }}-transcode + {{- end }} {{- else }} emptyDir: {} {{- end }} diff --git a/plex/templates/pvc.yaml b/plex/templates/pvc.yaml index 016a0db..562a393 100644 --- a/plex/templates/pvc.yaml +++ b/plex/templates/pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.persistence.config.enabled }} +{{- if and .Values.persistence.config.enabled (not .Values.persistence.config.existingClaim) }} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -16,7 +16,7 @@ spec: storage: {{ .Values.persistence.config.size | quote }} {{- end }} --- -{{- if .Values.persistence.transcode.enabled }} +{{- if and .Values.persistence.transcode.enabled (not .Values.persistence.transcode.existingClaim) }} apiVersion: v1 kind: PersistentVolumeClaim metadata: diff --git a/plex/values.yaml b/plex/values.yaml index a6a57c8..0186784 100644 --- a/plex/values.yaml +++ b/plex/values.yaml @@ -60,12 +60,16 @@ persistence: accessMode: ReadWriteOnce size: 10Gi mountPath: /config + # Optional: Use existing PVC for config + existingClaim: "" transcode: enabled: true storageClass: "" accessMode: ReadWriteOnce size: 20Gi mountPath: /transcode + # Optional: Use existing PVC for transcode + existingClaim: "" data: enabled: true storageClass: "" @@ -74,6 +78,9 @@ persistence: mountPath: /data # Optional: Use existing PVC existingClaim: "" + # Optional: Use existing media storage + # Example: "movies-pvc" to reuse storage from Radarr + # Example: "tv-pvc" to reuse storage from Sonarr # Hardware transcoding support # Note: Requires compatible hardware and drivers