Browse Source

Enable host networking when minio distributed mode is on

sonicaj 3 năm trước cách đây
mục cha
commit
0f8c3fba21

+ 14 - 2
test/minio/1.4.0/templates/_helpers.tpl

@@ -58,8 +58,20 @@ 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 " ") -}}
+{{- cat $arg (join " " (concat (.Values.distributedIps | default list) (.Values.extraArgs | default list))) -}}
 {{- else -}}
-{{- printf "%s %s" $arg ((concat (list "/export") (.Values.extraArgs | default list)) | join " ") -}}
+{{- cat $arg ((concat (list "/export") (.Values.extraArgs | default list)) | join " ") -}}
+{{- end -}}
+{{- end -}}
+
+
+{{/*
+Enable host networking
+*/}}
+{{- define "minio.hostNetworking" -}}
+{{- if .Values.distributedMode -}}
+{{- print "true" -}}
+{{- else -}}
+{{- print "false" -}}
 {{- end -}}
 {{- end -}}

+ 3 - 0
test/minio/1.4.0/templates/deployment.yaml

@@ -7,6 +7,8 @@ metadata:
     chart: {{ template "common.names.chart" . }}
     release: {{ .Release.Name }}
     heritage: {{ .Release.Service }}
+  annotations:
+    rollme: {{ randAlphaNum 5 | quote }}
 spec:
   replicas: {{ (default 1 .Values.replicas) }}
   strategy:
@@ -25,6 +27,7 @@ spec:
       annotations: {{ include "common.annotations" . | nindent 8 }}
     spec:
       serviceAccountName: {{ include "common.names.serviceAccountName" . | quote }}
+      hostNetwork: {{ include "minio.hostNetworking" . }}
       containers:
         - name: {{ .Chart.Name }}
           {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}

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

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