From b4b36c65035671139d5408f127e9db1fce4722ca Mon Sep 17 00:00:00 2001 From: sonicaj Date: Thu, 14 Oct 2021 23:25:46 +0500 Subject: [PATCH] Add ability to run minio in distributed mode --- test/minio/1.4.0/questions.yaml | 22 ++++++++++++++++++++++ test/minio/1.4.0/templates/_helpers.tpl | 13 +++++++++++++ test/minio/1.4.0/templates/deployment.yaml | 2 +- test/minio/1.4.0/test_values.yaml | 2 ++ 4 files changed, 38 insertions(+), 1 deletion(-) diff --git a/test/minio/1.4.0/questions.yaml b/test/minio/1.4.0/questions.yaml index 155ea73788..35a5d3dd14 100644 --- a/test/minio/1.4.0/questions.yaml +++ b/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" diff --git a/test/minio/1.4.0/templates/_helpers.tpl b/test/minio/1.4.0/templates/_helpers.tpl index dc65a42ead..a08646805b 100644 --- a/test/minio/1.4.0/templates/_helpers.tpl +++ b/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 -}} diff --git a/test/minio/1.4.0/templates/deployment.yaml b/test/minio/1.4.0/templates/deployment.yaml index f2e82b1f68..7be0948c3f 100644 --- a/test/minio/1.4.0/templates/deployment.yaml +++ b/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 diff --git a/test/minio/1.4.0/test_values.yaml b/test/minio/1.4.0/test_values.yaml index ef0683920d..7ff51ef123 100644 --- a/test/minio/1.4.0/test_values.yaml +++ b/test/minio/1.4.0/test_values.yaml @@ -16,3 +16,5 @@ service: consolePort: 32325 nodePort: 32324 updateStrategy: RollingUpdate +distributedMode: false +distributedIps: []