瀏覽代碼

Add ability to run minio in distributed mode

sonicaj 3 年之前
父節點
當前提交
b4b36c6503

+ 22 - 0
test/minio/1.4.0/questions.yaml

@@ -60,6 +60,28 @@ questions:
         - value: "Recreate"
           description: "Kill existing pods before creating new ones"
 
+  - variable: distributedMode
+    label: "Enable Distributed Mode"
+    group: "Minio Configuration"
+    schema:
+      type: boolean
+      default: false
+      show_subquestions_if: true
+      subquestions:
+        - variable: distributedIps
+          label: "Distributed Minio URI(s)"
+          schema:
+            type: list
+            required: true
+            default: []
+            items:
+              - variable: ip
+                label: "Distributed Minio URI"
+                schema:
+                  type: string
+                  empty: false
+
+
   - variable: extraArgs
     label: "Minio Extra Arguments"
     group: "Minio Configuration"

+ 13 - 0
test/minio/1.4.0/templates/_helpers.tpl

@@ -50,3 +50,16 @@ Retrieve scheme/protocol for minio
 {{- print "http" -}}
 {{- end -}}
 {{- end -}}
+
+
+{{/*
+Retrieve command for minio application
+*/}}
+{{- define "minio.commandArgs" -}}
+{{- $arg := "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs server --console-address=':9001'" -}}
+{{- if .Values.distributedMode -}}
+{{- printf "%s %s" $arg ((concat (.Values.distributedIps | default list) (.Values.extraArgs | default list)) | join " ") -}}
+{{- else -}}
+{{- printf "%s %s" $arg ((concat (list "/export") (.Values.extraArgs | default list)) | join " ") -}}
+{{- end -}}
+{{- end -}}

+ 1 - 1
test/minio/1.4.0/templates/deployment.yaml

@@ -33,7 +33,7 @@ spec:
           command:
             - "/bin/sh"
             - "-ce"
-            - "/usr/bin/docker-entrypoint.sh minio -S /etc/minio/certs server /export --console-address=':9001' {{ (.Values.extraArgs | default list) | join " " }}"
+            - {{ include "minio.commandArgs" . }}
           ports:
             - name: api
               containerPort: 9000

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

@@ -16,3 +16,5 @@ service:
   consolePort: 32325
   nodePort: 32324
 updateStrategy: RollingUpdate
+distributedMode: false
+distributedIps: []