Skip to content

Commit 0412a79

Browse files
committed
do hostpath as volume on deployment
1 parent 78cccf3 commit 0412a79

File tree

4 files changed

+6
-36
lines changed

4 files changed

+6
-36
lines changed

charts/nextcloud/README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,6 @@ Nextcloud will *not* delete the PVCs when uninstalling the helm chart.
413413
| `persistence.nextcloudData.existingClaim` | see `persistence.existingClaim` | `nil` |
414414
| `persistence.nextcloudData.accessMode` | see `persistence.accessMode` | `ReadWriteOnce` |
415415
| `persistence.nextcloudData.size` | see `persistence.size` | `8Gi` |
416-
| `persistence.nextcloudData.hostName` | Name of host node to create a pv for local storageClass | `nil` |
417416
| `persistence.nextcloudData.hostPath` | Path on the host where nextcloud data is stored | `nil` |
418417

419418
### Metrics Configurations

charts/nextcloud/templates/deployment.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,12 @@ spec:
358358
{{- end }}
359359
{{- if and .Values.persistence.nextcloudData.enabled .Values.persistence.enabled }}
360360
- name: nextcloud-data
361+
{{- if .Values.persistence.nextcloudData.hostPath }}
362+
hostPath: {{ .Values.persistence.nextcloudData.hostPath }}
363+
{{- else }}
361364
persistentVolumeClaim:
362365
claimName: {{ if .Values.persistence.nextcloudData.existingClaim }}{{ .Values.persistence.nextcloudData.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud-data{{- end }}
366+
{{- end }}
363367
{{- end }}
364368
{{- if .Values.nextcloud.configs }}
365369
- name: nextcloud-config
Lines changed: 2 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,5 @@
1+
{{- if not .Values.persistence.nextcloudData.hostPath }}
12
{{- 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 }}
333
---
344
kind: PersistentVolumeClaim
355
apiVersion: v1
@@ -54,7 +24,5 @@ spec:
5424
{{- with .Values.persistence.nextcloudData.storageClass }}
5525
storageClassName: {{ ternary "" . (eq "-" .) }}
5626
{{- end }}
57-
{{- if .Values.persistence.nextcloudData.hostPath }}
58-
volumeName: {{ template "nextcloud.fullname" . }}-nextcloud-data
59-
{{- end }}
6027
{{- end }}
28+
{{- end }}

charts/nextcloud/values.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,6 @@ persistence:
753753
size: 8Gi
754754

755755
## If defined, use a hostPath volume for nextcloud data rather than a dynamically defined PVC.
756-
hostName:
757756
hostPath:
758757

759758
resources: {}

0 commit comments

Comments
 (0)