From 78cccf39e4ada3ef87906a9e386e6a2ee274b9da Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 4 Jan 2026 22:28:46 -0500 Subject: [PATCH 1/7] added hostpath volumes Signed-off-by: Ben --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 34 +++++++++-------- .../templates/nextcloud-data-pvc.yaml | 38 +++++++++++++++++-- charts/nextcloud/values.yaml | 4 ++ 4 files changed, 57 insertions(+), 21 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 15c16f6d..89d46161 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 8.7.0 +version: 8.8.0 # renovate: image=docker.io/library/nextcloud appVersion: 32.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 2f3bb007..1a7571e1 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -397,22 +397,24 @@ The [Nextcloud](https://hub.docker.com/_/nextcloud/) image stores the nextcloud Persistent Volume Claims are used to keep the data across deployments. This is known to work with GKE, EKS, K3s, and minikube. Nextcloud will *not* delete the PVCs when uninstalling the helm chart. -| Parameter | Description | Default | -| ----------------------------------------- | ---------------------------------------------------- | --------------- | -| `persistence.enabled` | Enable persistence using PVC | `false` | -| `persistence.annotations` | PVC annotations | `{}` | -| `persistence.labels` | PVC labels | `{}` | -| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` | -| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` | -| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` | -| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` | -| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` | -| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` | -| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` | -| `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` | -| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` | -| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` | +| Parameter | Description | Default | +|-------------------------------------------|---------------------------------------------------------|-----------------| +| `persistence.enabled` | Enable persistence using PVC | `false` | +| `persistence.annotations` | PVC annotations | `{}` | +| `persistence.labels` | PVC labels | `{}` | +| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` | +| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` | +| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` | +| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` | +| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` | +| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` | +| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` | +| `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` | +| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` | +| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` | +| `persistence.nextcloudData.hostName` | Name of host node to create a pv for local storageClass | `nil` | +| `persistence.nextcloudData.hostPath` | Path on the host where nextcloud data is stored | `nil` | ### Metrics Configurations diff --git a/charts/nextcloud/templates/nextcloud-data-pvc.yaml b/charts/nextcloud/templates/nextcloud-data-pvc.yaml index 38779155..fd630c1b 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -1,4 +1,35 @@ {{- if and .Values.persistence.enabled .Values.persistence.nextcloudData.enabled (not .Values.persistence.nextcloudData.existingClaim) }} +{{- if .Values.persistence.nextcloudData.hostPath }} +--- +apiVersion: v1 +kind: PersistentVolume +metadata: + name: {{ template "nextcloud.fullname" . }}-nextcloud-data +spec: + capacity: + storage: {{ .Values.persistence.nextcloudData.size | quote }} + accessModes: + - ReadWriteOnce + persistentVolumeReclaimPolicy: Retain + {{- with .Values.persistence.nextcloudData.storageClass }} + storageClassName: {{ ternary "" . (eq "-" .) }} + {{- end }} + claimRef: + name: {{ template "nextcloud.fullname" . }}-nextcloud-data + hostPath: + path: {{ .Values.persistence.nextcloudData.hostPath }} + type: Directory + {{- with .Values.persistence.nextcloudData.hostName }} + nodeAffinity: + required: + nodeSelectorTerms: + - matchExpressions: + - key: kubernetes.io/hostname + operator: In + values: + - {{ . }} + {{- end }} +{{- end }} --- kind: PersistentVolumeClaim apiVersion: v1 @@ -21,10 +52,9 @@ spec: requests: storage: {{ .Values.persistence.nextcloudData.size | quote }} {{- with .Values.persistence.nextcloudData.storageClass }} - {{- if (eq "-" .) }} - storageClassName: "" - {{- else }} - storageClassName: "{{ . }}" + storageClassName: {{ ternary "" . (eq "-" .) }} {{- end }} + {{- if .Values.persistence.nextcloudData.hostPath }} + volumeName: {{ template "nextcloud.fullname" . }}-nextcloud-data {{- end }} {{- end }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index dfde6ed8..c5c9aa03 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -752,6 +752,10 @@ persistence: accessMode: ReadWriteOnce size: 8Gi + ## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. + hostName: + hostPath: + resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little From 91424d969908d19b9751582ec2274c65fe717dc4 Mon Sep 17 00:00:00 2001 From: Ben Date: Wed, 7 Jan 2026 22:55:38 -0500 Subject: [PATCH 2/7] do hostpath as volume on deployment Signed-off-by: Ben --- charts/nextcloud/README.md | 1 - charts/nextcloud/templates/deployment.yaml | 6 ++++ .../templates/nextcloud-data-pvc.yaml | 36 ++----------------- charts/nextcloud/values.yaml | 1 - 4 files changed, 8 insertions(+), 36 deletions(-) diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 1a7571e1..bb7b8762 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -413,7 +413,6 @@ Nextcloud will *not* delete the PVCs when uninstalling the helm chart. | `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` | | `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` | | `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` | -| `persistence.nextcloudData.hostName` | Name of host node to create a pv for local storageClass | `nil` | | `persistence.nextcloudData.hostPath` | Path on the host where nextcloud data is stored | `nil` | ### Metrics Configurations diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 2e03dd60..f1bdebee 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -358,8 +358,14 @@ spec: {{- end }} {{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }} - name: nextcloud-data + {{- if .Values.persistence.nextcloudData.hostPath }} + hostPath: + path: {{ .Values.persistence.nextcloudData.hostPath }} + type: Directory + {{- else }} persistentVolumeClaim: claimName: {{ if .Values.persistence.nextcloudData.existingClaim }}{{ .Values.persistence.nextcloudData.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }} + {{- end }} {{- end }} {{- if .Values.nextcloud.configs }} - name: nextcloud-config diff --git a/charts/nextcloud/templates/nextcloud-data-pvc.yaml b/charts/nextcloud/templates/nextcloud-data-pvc.yaml index fd630c1b..1fa6390f 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -1,35 +1,5 @@ +{{- if not .Values.persistence.nextcloudData.hostPath }} {{- if and .Values.persistence.enabled .Values.persistence.nextcloudData.enabled (not .Values.persistence.nextcloudData.existingClaim) }} -{{- if .Values.persistence.nextcloudData.hostPath }} ---- -apiVersion: v1 -kind: PersistentVolume -metadata: - name: {{ template "nextcloud.fullname" . }}-nextcloud-data -spec: - capacity: - storage: {{ .Values.persistence.nextcloudData.size | quote }} - accessModes: - - ReadWriteOnce - persistentVolumeReclaimPolicy: Retain - {{- with .Values.persistence.nextcloudData.storageClass }} - storageClassName: {{ ternary "" . (eq "-" .) }} - {{- end }} - claimRef: - name: {{ template "nextcloud.fullname" . }}-nextcloud-data - hostPath: - path: {{ .Values.persistence.nextcloudData.hostPath }} - type: Directory - {{- with .Values.persistence.nextcloudData.hostName }} - nodeAffinity: - required: - nodeSelectorTerms: - - matchExpressions: - - key: kubernetes.io/hostname - operator: In - values: - - {{ . }} - {{- end }} -{{- end }} --- kind: PersistentVolumeClaim apiVersion: v1 @@ -54,7 +24,5 @@ spec: {{- with .Values.persistence.nextcloudData.storageClass }} storageClassName: {{ ternary "" . (eq "-" .) }} {{- end }} - {{- if .Values.persistence.nextcloudData.hostPath }} - volumeName: {{ template "nextcloud.fullname" . }}-nextcloud-data - {{- end }} {{- end }} +{{- end }} \ No newline at end of file diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index c5c9aa03..1c87c7d5 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -753,7 +753,6 @@ persistence: size: 8Gi ## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. - hostName: hostPath: resources: {} From ac541a69c6fe975fc6deb9047725570b18f8274b Mon Sep 17 00:00:00 2001 From: Ben Date: Thu, 8 Jan 2026 11:27:52 -0500 Subject: [PATCH 3/7] move to nextcloud-main Signed-off-by: Ben --- charts/nextcloud/README.md | 32 +++++++++---------- charts/nextcloud/templates/deployment.yaml | 14 ++++---- .../templates/nextcloud-data-pvc.yaml | 2 +- charts/nextcloud/values.yaml | 6 ++-- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index bb7b8762..1e3413c1 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -397,23 +397,23 @@ The [Nextcloud](https://hub.docker.com/_/nextcloud/) image stores the nextcloud Persistent Volume Claims are used to keep the data across deployments. This is known to work with GKE, EKS, K3s, and minikube. Nextcloud will *not* delete the PVCs when uninstalling the helm chart. -| Parameter | Description | Default | -|-------------------------------------------|---------------------------------------------------------|-----------------| -| `persistence.enabled` | Enable persistence using PVC | `false` | -| `persistence.annotations` | PVC annotations | `{}` | -| `persistence.labels` | PVC labels | `{}` | -| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` | -| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` | -| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` | -| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` | -| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` | -| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` | -| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` | +| Parameter | Description | Default | +|------------------------------------------|---------------------------------------------------------|-----------------| +| `persistence.enabled` | Enable persistence using PVC | `false` | +| `persistence.annotations` | PVC annotations | `{}` | +| `persistence.labels` | PVC labels | `{}` | +| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` | +| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` | +| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` | +| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` | +| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` | +| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` | +| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` | | `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` | -| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` | -| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` | -| `persistence.nextcloudData.hostPath` | Path on the host where nextcloud data is stored | `nil` | +| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` | +| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` | +| `persistence.hostPath` | Path on the host where nextcloud data is stored | `nil` | ### Metrics Configurations diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index f1bdebee..648778f5 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -350,22 +350,22 @@ spec: {{- end }} volumes: - name: nextcloud-main - {{- if .Values.persistence.enabled }} + {{- if and .Values.persistence.enabled }} + {{- if .Values.persistence.hostPath }} + hostPath: + path: {{ .Values.persistence.hostPath }} + type: DirectoryOrCreate + {{- else }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }} + {{- end }} {{- else }} emptyDir: {} {{- end }} {{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }} - name: nextcloud-data - {{- if .Values.persistence.nextcloudData.hostPath }} - hostPath: - path: {{ .Values.persistence.nextcloudData.hostPath }} - type: Directory - {{- else }} persistentVolumeClaim: claimName: {{ if .Values.persistence.nextcloudData.existingClaim }}{{ .Values.persistence.nextcloudData.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }} - {{- end }} {{- end }} {{- if .Values.nextcloud.configs }} - name: nextcloud-config diff --git a/charts/nextcloud/templates/nextcloud-data-pvc.yaml b/charts/nextcloud/templates/nextcloud-data-pvc.yaml index 1fa6390f..83495d50 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -1,4 +1,4 @@ -{{- if not .Values.persistence.nextcloudData.hostPath }} +{{- if not .Values.persistence.hostPath }} {{- if and .Values.persistence.enabled .Values.persistence.nextcloudData.enabled (not .Values.persistence.nextcloudData.existingClaim) }} --- kind: PersistentVolumeClaim diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 1c87c7d5..7ecc222d 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -740,6 +740,9 @@ persistence: accessMode: ReadWriteOnce size: 8Gi + ## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. + hostPath: + ## Use an additional pvc for the data directory rather than a subpath of the default PVC ## Useful to store data on a different storageClass (e.g. on slower disks) nextcloudData: @@ -752,9 +755,6 @@ persistence: accessMode: ReadWriteOnce size: 8Gi - ## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. - hostPath: - resources: {} # We usually recommend not to specify default resources and to leave this as a conscious # choice for the user. This also increases chances charts run on environments with little From cc9f111c50bae5b13a9db21296a4d353a0fd0fb6 Mon Sep 17 00:00:00 2001 From: Ben Date: Fri, 9 Jan 2026 14:25:51 -0500 Subject: [PATCH 4/7] don't create in case of drive being unmounted Signed-off-by: Ben --- charts/nextcloud/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 648778f5..4886cb09 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -354,7 +354,7 @@ spec: {{- if .Values.persistence.hostPath }} hostPath: path: {{ .Values.persistence.hostPath }} - type: DirectoryOrCreate + type: Directory {{- else }} persistentVolumeClaim: claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }} From 14117238a746e6107342d66d832e8325223c8625 Mon Sep 17 00:00:00 2001 From: WrenIX <133280015+wrenix@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:38:03 +0100 Subject: [PATCH 5/7] some small cleanups Signed-off-by: WrenIX <133280015+wrenix@users.noreply.github.com> --- charts/nextcloud/templates/deployment.yaml | 2 +- charts/nextcloud/templates/nextcloud-data-pvc.yaml | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 4886cb09..b0953a63 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -350,7 +350,7 @@ spec: {{- end }} volumes: - name: nextcloud-main - {{- if and .Values.persistence.enabled }} + {{- if .Values.persistence.enabled }} {{- if .Values.persistence.hostPath }} hostPath: path: {{ .Values.persistence.hostPath }} diff --git a/charts/nextcloud/templates/nextcloud-data-pvc.yaml b/charts/nextcloud/templates/nextcloud-data-pvc.yaml index 83495d50..1f275a6b 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -1,5 +1,10 @@ {{- if not .Values.persistence.hostPath }} -{{- if and .Values.persistence.enabled .Values.persistence.nextcloudData.enabled (not .Values.persistence.nextcloudData.existingClaim) }} +{{- if and + .Values.persistence.enabled + .Values.persistence.nextcloudData.enabled + (not .Values.persistence.hostPath) + (not .Values.persistence.nextcloudData.existingClaim) +}} --- kind: PersistentVolumeClaim apiVersion: v1 @@ -24,5 +29,4 @@ spec: {{- with .Values.persistence.nextcloudData.storageClass }} storageClassName: {{ ternary "" . (eq "-" .) }} {{- end }} -{{- end }} {{- end }} \ No newline at end of file From 2aa02f79f93bb565b696d47d28f91a17fff21841 Mon Sep 17 00:00:00 2001 From: WrenIX <133280015+wrenix@users.noreply.github.com> Date: Wed, 14 Jan 2026 21:57:36 +0100 Subject: [PATCH 6/7] Bump Nextcloud version to 8.9.0 Signed-off-by: WrenIX <133280015+wrenix@users.noreply.github.com> --- charts/nextcloud/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 23226455..f47602cf 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 8.8.1 +version: 8.9.0 # renovate: image=docker.io/library/nextcloud appVersion: 32.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. From 20e19e50520be27248b35da2121f8c4b9ee518ae Mon Sep 17 00:00:00 2001 From: WrenIX Date: Wed, 21 Jan 2026 18:17:32 +0100 Subject: [PATCH 7/7] fix: correct seperation of data and nextcloud values for hostPath Signed-off-by: WrenIX --- charts/nextcloud/README.md | 33 ++++++++++--------- charts/nextcloud/templates/deployment.yaml | 14 +++++--- .../templates/nextcloud-data-pvc.yaml | 5 ++- charts/nextcloud/templates/nextcloud-pvc.yaml | 6 +++- charts/nextcloud/values.yaml | 4 ++- 5 files changed, 37 insertions(+), 25 deletions(-) diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 1e3413c1..f42d2b64 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -397,23 +397,24 @@ The [Nextcloud](https://hub.docker.com/_/nextcloud/) image stores the nextcloud Persistent Volume Claims are used to keep the data across deployments. This is known to work with GKE, EKS, K3s, and minikube. Nextcloud will *not* delete the PVCs when uninstalling the helm chart. -| Parameter | Description | Default | -|------------------------------------------|---------------------------------------------------------|-----------------| -| `persistence.enabled` | Enable persistence using PVC | `false` | -| `persistence.annotations` | PVC annotations | `{}` | -| `persistence.labels` | PVC labels | `{}` | -| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` | -| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` | -| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` | -| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` | -| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` | -| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` | -| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` | -| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` | +| Parameter | Description | Default | +|-------------------------------------------|---------------------------------------------------------|-----------------| +| `persistence.enabled` | Enable persistence using PVC | `false` | +| `persistence.hostPath` | Path on the host where nextcloud data is stored | `nil` | +| `persistence.annotations` | PVC annotations | `{}` | +| `persistence.labels` | PVC labels | `{}` | +| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` | +| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` | +| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` | +| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` | +| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` | +| `persistence.nextcloudData.hostPath` | Path on the host where nextcloud data is stored | `nil` | +| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` | +| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` | +| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` | | `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` | -| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` | -| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` | -| `persistence.hostPath` | Path on the host where nextcloud data is stored | `nil` | +| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` | +| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` | ### Metrics Configurations diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index b0953a63..aaebfe6c 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -351,21 +351,27 @@ spec: volumes: - name: nextcloud-main {{- if .Values.persistence.enabled }} - {{- if .Values.persistence.hostPath }} + {{- with .Values.persistence.hostPath }} hostPath: - path: {{ .Values.persistence.hostPath }} + path: {{ . }} type: Directory {{- else }} persistentVolumeClaim: - claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }} + claimName: {{ with .Values.persistence.existingClaim }}{{ . }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }} {{- end }} {{- else }} emptyDir: {} {{- end }} {{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }} - name: nextcloud-data + {{- with .Values.persistence.nextcloudData.hostPath }} + hostPath: + path: {{ . }} + type: Directory + {{- else }} persistentVolumeClaim: - claimName: {{ if .Values.persistence.nextcloudData.existingClaim }}{{ .Values.persistence.nextcloudData.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }} + claimName: {{ with .Values.persistence.nextcloudData.existingClaim }}{{ . }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }} + {{- end }} {{- end }} {{- if .Values.nextcloud.configs }} - name: nextcloud-config diff --git a/charts/nextcloud/templates/nextcloud-data-pvc.yaml b/charts/nextcloud/templates/nextcloud-data-pvc.yaml index 1f275a6b..e333b3ae 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -1,8 +1,7 @@ -{{- if not .Values.persistence.hostPath }} {{- if and .Values.persistence.enabled .Values.persistence.nextcloudData.enabled - (not .Values.persistence.hostPath) + (not .Values.persistence.nextcloudData.hostPath) (not .Values.persistence.nextcloudData.existingClaim) }} --- @@ -29,4 +28,4 @@ spec: {{- with .Values.persistence.nextcloudData.storageClass }} storageClassName: {{ ternary "" . (eq "-" .) }} {{- end }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/nextcloud/templates/nextcloud-pvc.yaml b/charts/nextcloud/templates/nextcloud-pvc.yaml index d38ad807..c1b604a3 100644 --- a/charts/nextcloud/templates/nextcloud-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-pvc.yaml @@ -1,4 +1,8 @@ -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} +{{- if and + .Values.persistence.enabled + (not .Values.persistence.hostPath) + (not .Values.persistence.existingClaim) +}} kind: PersistentVolumeClaim apiVersion: v1 metadata: diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index a887d79a..fa9b9125 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -778,13 +778,15 @@ persistence: accessMode: ReadWriteOnce size: 8Gi - ## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. + # -- If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. hostPath: ## Use an additional pvc for the data directory rather than a subpath of the default PVC ## Useful to store data on a different storageClass (e.g. on slower disks) nextcloudData: enabled: false + # -- If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. + hostPath: subPath: labels: {} annotations: {}