From f5a9ead1ddd382d89e4566488d5ec9eb098fe674 Mon Sep 17 00:00:00 2001 From: "Balasankar \"Balu\" C" Date: Tue, 17 Nov 2020 17:04:01 +0530 Subject: [PATCH] Use public Minio endpoint in object storage settings Signed-off-by: Balasankar "Balu" C --- charts/gitlab/templates/_minio.tpl | 11 +++++++++++ charts/gitlab/templates/_objectStorage.tpl | 2 +- charts/registry/templates/_helpers.tpl | 6 +----- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/charts/gitlab/templates/_minio.tpl b/charts/gitlab/templates/_minio.tpl index a512d83ca6..9635fec68d 100644 --- a/charts/gitlab/templates/_minio.tpl +++ b/charts/gitlab/templates/_minio.tpl @@ -9,6 +9,17 @@ Return the minio service endpoint {{- printf "http://%s-%s:%d" .Release.Name $name $port -}} {{- end -}} +{{/* +Return the minio public endpoint +*/}} +{{- define "gitlab.minio.publicEndpoint" -}} +{{- if or .Values.global.hosts.https .Values.global.hosts.minio.https -}} +{{- printf "https://%s" (include "gitlab.minio.hostname" .) -}} +{{- else -}} +{{- printf "http://%s" (include "gitlab.minio.hostname" .) -}} +{{- end -}} +{{- end -}} + {{/* Minio has it's own secret mounting procedure, so it receives more special attention compared to normal objectStorage secret mounting. */}} diff --git a/charts/gitlab/templates/_objectStorage.tpl b/charts/gitlab/templates/_objectStorage.tpl index e000711406..691cefb0c6 100644 --- a/charts/gitlab/templates/_objectStorage.tpl +++ b/charts/gitlab/templates/_objectStorage.tpl @@ -49,7 +49,7 @@ connection: provider: AWS region: us-east-1 host: {{ template "gitlab.minio.hostname" .context }} - endpoint: {{ template "gitlab.minio.endpoint" .context }} + endpoint: {{ template "gitlab.minio.publicEndpoint" .context }} path_style: true aws_access_key_id: "<%= File.read('/etc/gitlab/minio/accesskey').strip.dump[1..-2] %>" aws_secret_access_key: "<%= File.read('/etc/gitlab/minio/secretkey').strip.dump[1..-2] %>" diff --git a/charts/registry/templates/_helpers.tpl b/charts/registry/templates/_helpers.tpl index 760e02d136..2bd0d548e7 100644 --- a/charts/registry/templates/_helpers.tpl +++ b/charts/registry/templates/_helpers.tpl @@ -49,11 +49,7 @@ hostname part of the url. */}} {{- define "registry.minio.url" -}} {{- if .Values.minio.redirect -}} - {{- if or .Values.global.hosts.https .Values.global.hosts.minio.https -}} - {{- printf "https://%s" (include "gitlab.minio.hostname" .) -}} - {{- else -}} - {{- printf "http://%s" (include "gitlab.minio.hostname" .) -}} - {{- end -}} + {{- include "gitlab.minio.publicEndpoint" . -}} {{- else -}} {{- include "gitlab.minio.endpoint" . -}} {{- end -}} -- GitLab