diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index c7a8d8df..1c4b39b7 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 8.8.2 +version: 8.9.0 # renovate: image=docker.io/library/nextcloud appVersion: 32.0.5 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..f42d2b64 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.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` | ### Metrics Configurations diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 2e03dd60..aaebfe6c 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -351,15 +351,27 @@ spec: volumes: - name: nextcloud-main {{- if .Values.persistence.enabled }} + {{- with .Values.persistence.hostPath }} + 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 38779155..e333b3ae 100644 --- a/charts/nextcloud/templates/nextcloud-data-pvc.yaml +++ b/charts/nextcloud/templates/nextcloud-data-pvc.yaml @@ -1,4 +1,9 @@ -{{- 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.nextcloudData.hostPath) + (not .Values.persistence.nextcloudData.existingClaim) +}} --- kind: PersistentVolumeClaim apiVersion: v1 @@ -21,10 +26,6 @@ spec: requests: storage: {{ .Values.persistence.nextcloudData.size | quote }} {{- with .Values.persistence.nextcloudData.storageClass }} - {{- if (eq "-" .) }} - storageClassName: "" - {{- else }} - storageClassName: "{{ . }}" - {{- end }} + storageClassName: {{ ternary "" . (eq "-" .) }} {{- end }} {{- 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 75257d67..fa9b9125 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -778,10 +778,15 @@ 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: enabled: false + # -- If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC. + hostPath: subPath: labels: {} annotations: {}