From bce2e26cda391a8ea88c793169e07c1e348ccb58 Mon Sep 17 00:00:00 2001 From: sonicaj Date: Thu, 14 Oct 2021 23:46:41 +0500 Subject: [PATCH] Allow specifying host path volumes for minio application --- test/minio/1.4.0/questions.yaml | 30 ++++++++++++++++++++-- test/minio/1.4.0/templates/deployment.yaml | 13 ++++++++-- test/minio/1.4.0/test_values.yaml | 1 + 3 files changed, 40 insertions(+), 4 deletions(-) diff --git a/test/minio/1.4.0/questions.yaml b/test/minio/1.4.0/questions.yaml index 35a5d3dd14..d42ab51998 100644 --- a/test/minio/1.4.0/questions.yaml +++ b/test/minio/1.4.0/questions.yaml @@ -3,10 +3,10 @@ groups: description: "Image to be used for container" - name: "Workload Configuration" description: "Configure workload deployment" - - name: "Storage" - description: "Configure Storage for Nextcloud" - name: "Minio Configuration" description: "Configure Minio credentials" + - name: "Storage" + description: "Configure Storage for Nextcloud" - name: "Advanced DNS Settings" description: "Configure DNS settings" @@ -186,6 +186,7 @@ questions: group: "Storage" schema: type: dict + show_if: [["distributedMode", "=", false]] attrs: - variable: export label: "Data Volume" @@ -222,3 +223,28 @@ questions: schema: type: hostpath required: true + + - variable: extraAppVolumeMounts + label: "Extra Host Path Volumes" + group: "Storage" + schema: + type: list + items: + - variable: extraAppVolume + label: "Host Path Volume" + description: "Add an extra host path volume for Minio application" + schema: + type: dict + attrs: + - variable: mountPath + label: "Mount Path in Pod" + description: "Path where the volume will be mounted inside the pod" + schema: + type: path + required: true + - variable: hostPath + label: "Host Path" + description: "Host path" + schema: + type: hostpath + required: true diff --git a/test/minio/1.4.0/templates/deployment.yaml b/test/minio/1.4.0/templates/deployment.yaml index 7be0948c3f..1422b0dc2b 100644 --- a/test/minio/1.4.0/templates/deployment.yaml +++ b/test/minio/1.4.0/templates/deployment.yaml @@ -30,6 +30,10 @@ spec: {{ include "common.containers.imageConfig" .Values.image | nindent 10 }} volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }} {{- include "minio.tlsKeysVolumeMount" . | nindent 12 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + mountPath: {{ $hostPathConfiguration.mountPath }} + {{ end }} command: - "/bin/sh" - "-ce" @@ -50,5 +54,10 @@ spec: {{ $envList = mustAppend $envList (dict "name" "MINIO_ROOT_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "secretkey") }} {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 12 }} {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} -{{ include "common.storage.allAppVolumes" .Values | nindent 6 }} -{{- include "minio.tlsKeysVolume" . | nindent 8 }} + volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} + {{- include "minio.tlsKeysVolume" . | nindent 8 }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} + {{ end }} diff --git a/test/minio/1.4.0/test_values.yaml b/test/minio/1.4.0/test_values.yaml index 7ff51ef123..ede0a52252 100644 --- a/test/minio/1.4.0/test_values.yaml +++ b/test/minio/1.4.0/test_values.yaml @@ -18,3 +18,4 @@ service: updateStrategy: RollingUpdate distributedMode: false distributedIps: [] +extraAppVolumeMounts: [] \ No newline at end of file