Skip to content

Commit 12ca7ae

Browse files
committed
fix: correct seperation of data and nextcloud values for hostPath
1 parent 0d8ae46 commit 12ca7ae

File tree

5 files changed

+37
-25
lines changed

5 files changed

+37
-25
lines changed

charts/nextcloud/README.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -397,23 +397,24 @@ The [Nextcloud](https://hub.docker.com/_/nextcloud/) image stores the nextcloud
397397
Persistent Volume Claims are used to keep the data across deployments. This is known to work with GKE, EKS, K3s, and minikube.
398398
Nextcloud will *not* delete the PVCs when uninstalling the helm chart.
399399

400-
| Parameter | Description | Default |
401-
|------------------------------------------|---------------------------------------------------------|-----------------|
402-
| `persistence.enabled` | Enable persistence using PVC | `false` |
403-
| `persistence.annotations` | PVC annotations | `{}` |
404-
| `persistence.labels` | PVC labels | `{}` |
405-
| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` |
406-
| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` |
407-
| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` |
408-
| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` |
409-
| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` |
410-
| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` |
411-
| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` |
412-
| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` |
400+
| Parameter | Description | Default |
401+
|-------------------------------------------|---------------------------------------------------------|-----------------|
402+
| `persistence.enabled` | Enable persistence using PVC | `false` |
403+
| `persistence.hostPath` | Path on the host where nextcloud data is stored | `nil` |
404+
| `persistence.annotations` | PVC annotations | `{}` |
405+
| `persistence.labels` | PVC labels | `{}` |
406+
| `persistence.storageClass` | PVC Storage Class for nextcloud volume | `nil` |
407+
| `persistence.existingClaim` | An Existing PVC name for nextcloud volume | `nil` |
408+
| `persistence.accessMode` | PVC Access Mode for nextcloud volume | `ReadWriteOnce` |
409+
| `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` |
410+
| `persistence.nextcloudData.enabled` | Create a second PVC for the data folder in nextcloud | `false` |
411+
| `persistence.nextcloudData.hostPath` | Path on the host where nextcloud data is stored | `nil` |
412+
| `persistence.nextcloudData.annotations` | see `persistence.annotations` | `{}` |
413+
| `persistence.nextcloudData.labels` | see `persistence.labels` | `{}` |
414+
| `persistence.nextcloudData.storageClass` | see `persistence.storageClass` | `nil` |
413415
| `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` |
414-
| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` |
415-
| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` |
416-
| `persistence.hostPath` | Path on the host where nextcloud data is stored | `nil` |
416+
| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` |
417+
| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` |
417418

418419
### Metrics Configurations
419420

charts/nextcloud/templates/deployment.yaml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -351,21 +351,27 @@ spec:
351351
volumes:
352352
- name: nextcloud-main
353353
{{- if .Values.persistence.enabled }}
354-
{{- if .Values.persistence.hostPath }}
354+
{{- with .Values.persistence.hostPath }}
355355
hostPath:
356-
path: {{ .Values.persistence.hostPath }}
356+
path: {{ . }}
357357
type: Directory
358358
{{- else }}
359359
persistentVolumeClaim:
360-
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }}
360+
claimName: {{ with .Values.persistence.existingClaim }}{{ . }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }}
361361
{{- end }}
362362
{{- else }}
363363
emptyDir: {}
364364
{{- end }}
365365
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
366+
{{- with .Values.persistence.nextcloudData.hostPath }}
367+
hostPath:
368+
path: {{ . }}
369+
type: Directory
370+
{{- else }}
366371
- name: nextcloud-data
367372
persistentVolumeClaim:
368-
claimName: {{ if .Values.persistence.nextcloudData.existingClaim }}{{ .Values.persistence.nextcloudData.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }}
373+
claimName: {{ with .Values.persistence.nextcloudData.existingClaim }}{{ . }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }}
374+
{{- end }}
369375
{{- end }}
370376
{{- if .Values.nextcloud.configs }}
371377
- name: nextcloud-config

charts/nextcloud/templates/nextcloud-data-pvc.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
{{- if not .Values.persistence.hostPath }}
21
{{- if and
32
.Values.persistence.enabled
43
.Values.persistence.nextcloudData.enabled
5-
(not .Values.persistence.hostPath)
4+
(not .Values.persistence.nextcloudData.hostPath)
65
(not .Values.persistence.nextcloudData.existingClaim)
76
}}
87
---
@@ -29,4 +28,4 @@ spec:
2928
{{- with .Values.persistence.nextcloudData.storageClass }}
3029
storageClassName: {{ ternary "" . (eq "-" .) }}
3130
{{- end }}
32-
{{- end }}
31+
{{- end }}

charts/nextcloud/templates/nextcloud-pvc.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }}
1+
{{- if and
2+
.Values.persistence.enabled
3+
(not .Values.persistence.hostPath)
4+
(not .Values.persistence.existingClaim)
5+
}}
26
kind: PersistentVolumeClaim
37
apiVersion: v1
48
metadata:

charts/nextcloud/values.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,13 +778,15 @@ persistence:
778778
accessMode: ReadWriteOnce
779779
size: 8Gi
780780

781-
## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC.
781+
# -- If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC.
782782
hostPath:
783783

784784
## Use an additional pvc for the data directory rather than a subpath of the default PVC
785785
## Useful to store data on a different storageClass (e.g. on slower disks)
786786
nextcloudData:
787787
enabled: false
788+
# -- If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC.
789+
hostPath:
788790
subPath:
789791
labels: {}
790792
annotations: {}

0 commit comments

Comments
 (0)