diff --git a/README.md b/README.md index ac47268..6bec2a8 100644 --- a/README.md +++ b/README.md @@ -76,6 +76,7 @@ The CR is quite simple to configure, and I tried to keep the number of parameter | general.pgid | The GID for the process | 1000 | | general.puid | The UID for the process | 1000 | | general.nodeSelector | Node Selector for all the pods | {} | +| general.storage.customVolume | Flag if you want to supply your own volume and not use a PVC | false | | general.storage.pvcName | Name of the persistenVolumeClaim configured in deployments | mediaserver-pvc | | general.storage.pvcStorageClass | Specifies a storageClass for the PVC | "" | | general.storage.size | Size of the persistenVolume | 50Gi | @@ -85,6 +86,7 @@ The CR is quite simple to configure, and I tried to keep the number of parameter | general.storage.subPaths.transmission | Default subpath for transmission downloads on used storage | general.storage.subPaths.downloads/transmission | | general.storage.subPaths.sabnzbd | Default subpath for sabnzbd downloads on used storage | general.storage.subPaths.downloads/sabnzbd | | general.storage.subPaths.config | Default subpath for all config files on used storage | config | +| general.storage.volumes | Supply custom volume to be mounted for all services | {} | # Plex diff --git a/helm-charts/k8s-mediaserver/templates/jackett-resources.yml b/helm-charts/k8s-mediaserver/templates/jackett-resources.yml index e5a8c57..fc04168 100644 --- a/helm-charts/k8s-mediaserver/templates/jackett-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/jackett-resources.yml @@ -84,9 +84,14 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} 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 }} - name: init-files-jackett configMap: defaultMode: 493 diff --git a/helm-charts/k8s-mediaserver/templates/plex-resources.yml b/helm-charts/k8s-mediaserver/templates/plex-resources.yml index 09b2c5a..e0038c0 100644 --- a/helm-charts/k8s-mediaserver/templates/plex-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/plex-resources.yml @@ -29,9 +29,14 @@ spec: app: plex 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 }} containers: - name: {{ .Chart.Name }} envFrom: @@ -137,4 +142,4 @@ spec: port: number: {{ .Values.plex.service.port }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/helm-charts/k8s-mediaserver/templates/radarr-resources.yml b/helm-charts/k8s-mediaserver/templates/radarr-resources.yml index 578ad55..a13de41 100644 --- a/helm-charts/k8s-mediaserver/templates/radarr-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/radarr-resources.yml @@ -91,9 +91,14 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} 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 }} - name: init-files-radarr configMap: defaultMode: 493 diff --git a/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml b/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml index 8b6c968..be0fe8a 100644 --- a/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/sabnzbd-resources.yml @@ -47,7 +47,7 @@ data: api_key = 7a50bedb4f764603bab47212c7a16ec4 nzb_key = c7378d3a9b024117baacb21de005b1a6 permissions = "" - download_dir = /{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.sabnzbd }}/incomplete-downloads + download_dir = /{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.sabnzbd }}/incomplete download_free = "" complete_dir = /{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.sabnzbd }}/complete complete_free = "" @@ -387,18 +387,20 @@ spec: subPath: "{{ .Values.general.storage.subPaths.config }}/sabnzbd" - name: mediaserver-volume mountPath: "/downloads" - subPath: "{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.sabnzbd }}/complete" - - name: mediaserver-volume - mountPath: "/incomplete-downloads" - subPath: "{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.sabnzbd }}/incomplete" + subPath: "{{ .Values.general.storage.subPaths.downloads }}" {{- with .Values.sabnzbd.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} 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 }} - name: init-files-sabnzbd configMap: defaultMode: 493 @@ -514,4 +516,4 @@ spec: port: number: {{ .Values.sabnzbd.service.http.port }} {{ end }} -{{ end }} \ No newline at end of file +{{ end }} diff --git a/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml b/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml index d29f993..9197f5d 100644 --- a/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/sonarr-resources.yml @@ -90,9 +90,14 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} 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 }} - name: init-files-sonarr configMap: defaultMode: 493 diff --git a/helm-charts/k8s-mediaserver/templates/storage-resources.yml b/helm-charts/k8s-mediaserver/templates/storage-resources.yml index 78d7ed6..505590d 100644 --- a/helm-charts/k8s-mediaserver/templates/storage-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/storage-resources.yml @@ -1,3 +1,4 @@ +{{ if not .Values.general.storage.customVolume }} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -8,4 +9,5 @@ spec: resources: requests: storage: {{ .Values.general.storage.size }} - storageClassName: {{ if (kindIs "invalid" .Values.general.storage.pvcStorageClass) }}""{{- else }}{{ .Values.general.storage.pvcStorageClass | quote }}{{- end }} \ No newline at end of file + storageClassName: {{ if (kindIs "invalid" .Values.general.storage.pvcStorageClass) }}""{{- else }}{{ .Values.general.storage.pvcStorageClass | quote }}{{- end }} +{{ end }} diff --git a/helm-charts/k8s-mediaserver/templates/transmission-resources.yml b/helm-charts/k8s-mediaserver/templates/transmission-resources.yml index a71dba2..0d20a53 100644 --- a/helm-charts/k8s-mediaserver/templates/transmission-resources.yml +++ b/helm-charts/k8s-mediaserver/templates/transmission-resources.yml @@ -26,13 +26,13 @@ data: "blocklist-url": "http://www.example.com/blocklist", "cache-size-mb": 4, "dht-enabled": true, - "download-dir": "/downloads/complete", + "download-dir": "/{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.transmission }}/complete", "download-queue-enabled": true, "download-queue-size": 5, "encryption": 1, "idle-seeding-limit": 30, "idle-seeding-limit-enabled": false, - "incomplete-dir": "/downloads/incomplete", + "incomplete-dir": "/{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.transmission }}/incomplete", "incomplete-dir-enabled": true, "lpd-enabled": false, "message-level": 2, @@ -154,15 +154,20 @@ spec: subPath: "{{ .Values.general.storage.subPaths.config }}/transmission" - name: mediaserver-volume mountPath: "/downloads" - subPath: "{{ .Values.general.storage.subPaths.downloads }}/{{ .Values.general.storage.subPaths.transmission }}" + subPath: "{{ .Values.general.storage.subPaths.downloads }}" {{- with .Values.transmission.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} 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 }} - name: init-files-transmission configMap: defaultMode: 493 @@ -230,7 +235,7 @@ spec: selector: app: transmission --- -{{ if .Values.transmission.service.extraLBService }} +{{ if .Values.transmission.service.utp.extraLBService }} apiVersion: v1 kind: Service metadata: @@ -247,6 +252,8 @@ spec: selector: app: transmission --- +{{ end }} +{{ if .Values.transmission.service.peer.extraLBService }} apiVersion: v1 kind: Service metadata: @@ -257,7 +264,7 @@ spec: type: LoadBalancer ports: - port: {{ .Values.transmission.service.peer.port }} - targetPort: {{ .Values.transmission.container.peer.port }} + targetPort: {{ .Values.transmission.container.port.peer }} protocol: TCP name: trans-peer-tcp selector: @@ -273,7 +280,7 @@ spec: type: LoadBalancer ports: - port: {{ .Values.transmission.service.peer.port }} - targetPort: {{ .Values.transmission.container.peer.port }} + targetPort: {{ .Values.transmission.container.port.peer }} protocol: UDP name: trans-peer-udp selector: diff --git a/helm-charts/k8s-mediaserver/values.yaml b/helm-charts/k8s-mediaserver/values.yaml index 51408fd..2d832a5 100644 --- a/helm-charts/k8s-mediaserver/values.yaml +++ b/helm-charts/k8s-mediaserver/values.yaml @@ -10,8 +10,9 @@ general: puid: 1000 #GID to run the process with pgid: 1000 - #Name, size and SC of needed PVC + #Persistent storage selections and pathing storage: + customVolume: false #set to true if not using a PVC (must provide volume below) pvcName: mediaserver-pvc size: 5Gi pvcStorageClass: [] @@ -23,6 +24,9 @@ general: transmission: transmission sabnzbd: sabnzbd config: config + volumes: {} + # hostPath: + # path: /mnt/share sonarr: enabled: true