Commit 8e719a47 authored by Waqar Ahmed's avatar Waqar Ahmed

Allow using host path or ix volume for persistent data storage

parent aa33f73f
...@@ -3,6 +3,8 @@ groups: ...@@ -3,6 +3,8 @@ groups:
description: "Image to be used for container" description: "Image to be used for container"
- name: "Nextcloud Configuration" - name: "Nextcloud Configuration"
description: "Configuration details for Nextcloud workload" description: "Configuration details for Nextcloud workload"
- name: "Storage Configuration"
description: "Configure Storage for Nextcloud"
questions: questions:
# Image related # Image related
...@@ -101,3 +103,52 @@ questions: ...@@ -101,3 +103,52 @@ questions:
max: 65535 max: 65535
default: 9000 default: 9000
required: true required: true
- variable: configureiXVolume
label: "Configure iX Volume"
group: "Storage Configuration"
description: "Use iX Volume for persistent storage"
schema:
type: boolean
default: true
required: true
show_subquestions_if: true
subquestions:
- variable: volume
label: "Configure iXVolume"
group: "Storage Configuration"
schema:
type: dict
$ref:
- "normalize/ixVolume"
attrs:
- variable: mountPath
label: "Mount Path"
description: "Path where the volume will be mounted inside the pod"
schema:
type: path
editable: false
default: "/var/www"
- variable: datasetName
label: "Dataset Name"
schema:
type: string
required: true
- variable: configureHostPath
label: "Configure Host Path for storage"
description: "Use a path on host for persistent data storage"
group: "Storage Configuration"
schema:
type: boolean
default: false
required: true
show_if: [["configureiXVolume", "=", false]]
show_subquestions_if: true
subquestions:
- variable: volumeHostPath
label: "Host Path"
group: "Storage Configuration"
schema:
type: hostpath
required: true
...@@ -47,3 +47,17 @@ Create chart name and version as used by the chart label. ...@@ -47,3 +47,17 @@ Create chart name and version as used by the chart label.
{{- define "nextcloud.chart" -}} {{- define "nextcloud.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{/*
Retrieve host path defined in volume
*/}}
{{- define "configuredHostPath" -}}
{{- if .Values.configureiXVolume -}}
{{- $volDict := first .Values.ixVolumes -}}
{{- $volDict.hostPath -}}
{{- else if .Values.configureHostPath -}}
{{- .Values.volumeHostPath -}}
{{- else -}}
{{- printf "" -}}
{{- end -}}
{{- end -}}
...@@ -328,6 +328,9 @@ spec: ...@@ -328,6 +328,9 @@ spec:
{{- if .Values.persistence.enabled }} {{- if .Values.persistence.enabled }}
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }} claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "nextcloud.fullname" . }}-nextcloud{{- end }}
{{- else if ne (include "configuredHostPath" .) "" }}
hostPath:
path: {{ template "configuredHostPath" . }}
{{- else }} {{- else }}
emptyDir: {} emptyDir: {}
{{- end }} {{- end }}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment