Explorar el Código

Allow specifying host path volumes for minio application

sonicaj hace 3 años
padre
commit
bce2e26cda

+ 28 - 2
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

+ 11 - 2
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 }}

+ 1 - 0
test/minio/1.4.0/test_values.yaml

@@ -18,3 +18,4 @@ service:
 updateStrategy: RollingUpdate
 distributedMode: false
 distributedIps: []
+extraAppVolumeMounts: []