From 78cccf39e4ada3ef87906a9e386e6a2ee274b9da Mon Sep 17 00:00:00 2001 From: Ben Date: Sun, 4 Jan 2026 22:28:46 -0500 Subject: [PATCH 1/4] 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/4] 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/4] 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/4] 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 }}