Skip to content

Commit d26ffae

Browse files
committed
added hostpath volumes
1 parent 7edffec commit d26ffae

File tree

4 files changed

+57
-21
lines changed

4 files changed

+57
-21
lines changed

charts/nextcloud/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v2
22
name: nextcloud
3-
version: 8.7.0
3+
version: 8.8.0
44
# renovate: image=docker.io/library/nextcloud
55
appVersion: 32.0.3
66
description: A file sharing server that puts the control and security of your own data back into your hands.

charts/nextcloud/README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -397,22 +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` |
413-
| `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` |
414-
| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` |
415-
| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` |
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` |
413+
| `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.nextcloudData.hostName` | Name of host node to create a pv for local storageClass | `nil` |
417+
| `persistence.nextcloudData.hostPath` | Path on the host where nextcloud data is stored | `nil` |
416418

417419
### Metrics Configurations
418420

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

Lines changed: 34 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,35 @@
11
{{- if and .Values.persistence.enabled .Values.persistence.nextcloudData.enabled (not .Values.persistence.nextcloudData.existingClaim) }}
2+
{{- if .Values.persistence.nextcloudData.hostPath }}
3+
---
4+
apiVersion: v1
5+
kind: PersistentVolume
6+
metadata:
7+
name: {{ template "nextcloud.fullname" . }}-nextcloud-data
8+
spec:
9+
capacity:
10+
storage: {{ .Values.persistence.nextcloudData.size | quote }}
11+
accessModes:
12+
- ReadWriteOnce
13+
persistentVolumeReclaimPolicy: Retain
14+
{{- with .Values.persistence.nextcloudData.storageClass }}
15+
storageClassName: {{ ternary "" . (eq "-" .) }}
16+
{{- end }}
17+
claimRef:
18+
name: {{ template "nextcloud.fullname" . }}-nextcloud-data
19+
hostPath:
20+
path: {{ .Values.persistence.nextcloudData.hostPath }}
21+
type: Directory
22+
{{- with .Values.persistence.nextcloudData.hostName }}
23+
nodeAffinity:
24+
required:
25+
nodeSelectorTerms:
26+
- matchExpressions:
27+
- key: kubernetes.io/hostname
28+
operator: In
29+
values:
30+
- {{ . }}
31+
{{- end }}
32+
{{- end }}
233
---
334
kind: PersistentVolumeClaim
435
apiVersion: v1
@@ -21,10 +52,9 @@ spec:
2152
requests:
2253
storage: {{ .Values.persistence.nextcloudData.size | quote }}
2354
{{- with .Values.persistence.nextcloudData.storageClass }}
24-
{{- if (eq "-" .) }}
25-
storageClassName: ""
26-
{{- else }}
27-
storageClassName: "{{ . }}"
55+
storageClassName: {{ ternary "" . (eq "-" .) }}
2856
{{- end }}
57+
{{- if .Values.persistence.nextcloudData.hostPath }}
58+
volumeName: {{ template "nextcloud.fullname" . }}-nextcloud-data
2959
{{- end }}
3060
{{- end }}

charts/nextcloud/values.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,10 @@ persistence:
752752
accessMode: ReadWriteOnce
753753
size: 8Gi
754754

755+
## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC.
756+
hostName:
757+
hostPath:
758+
755759
resources: {}
756760
# We usually recommend not to specify default resources and to leave this as a conscious
757761
# choice for the user. This also increases chances charts run on environments with little

0 commit comments

Comments
 (0)