From 8ebf7a958efd1629cb204599561ea885ea587aad Mon Sep 17 00:00:00 2001 From: ideal-respectable-trumpet Date: Wed, 19 Mar 2025 09:03:53 +0100 Subject: [PATCH 1/2] Add domain in values.yaml --- helm/minio/templates/_helpers.tpl | 13 +++++++++++++ helm/minio/templates/console-ingress.yaml | 7 +++++-- helm/minio/templates/ingress.yaml | 7 +++++-- helm/minio/values.yaml | 3 +++ 4 files changed, 26 insertions(+), 4 deletions(-) diff --git a/helm/minio/templates/_helpers.tpl b/helm/minio/templates/_helpers.tpl index 1cb209e5e..2a2e62ef4 100644 --- a/helm/minio/templates/_helpers.tpl +++ b/helm/minio/templates/_helpers.tpl @@ -103,6 +103,19 @@ Determine secret name. {{- end -}} {{- end -}} +{{/* +Determine domain for hosts +*/}} +{{- define "minio.domain" -}} + {{- if .Values.global.domain -}} + {{- printf ".%s" .Values.global.domain -}} + {{- else if .Values.domain -}} + {{- printf ".%s" .Values.domain -}} + {{- else -}} + {{- print "" -}} + {{- end -}} +{{- end -}} + {{/* Determine name for scc role and rolebinding */}} diff --git a/helm/minio/templates/console-ingress.yaml b/helm/minio/templates/console-ingress.yaml index 79a2b1b58..363529894 100644 --- a/helm/minio/templates/console-ingress.yaml +++ b/helm/minio/templates/console-ingress.yaml @@ -32,6 +32,7 @@ spec: {{- end }} {{- end }} rules: + {{- $domain := include "minio.domain" . -}} {{- range .Values.consoleIngress.hosts }} - http: paths: @@ -41,7 +42,7 @@ spec: backend: service: name: {{ $fullName }} - port: + port: number: {{ $servicePort }} {{- else }} backend: @@ -49,7 +50,9 @@ spec: servicePort: {{ $servicePort }} {{- end }} {{- if . }} - host: {{ tpl . $ | quote }} + {{- $host := . }} + {{- $hostWithDomain := printf "%s%s" $host $domain }} + host: {{ $hostWithDomain | quote }} {{- end }} {{- end }} {{- end }} diff --git a/helm/minio/templates/ingress.yaml b/helm/minio/templates/ingress.yaml index 1a564c6bc..cdfa0cab0 100644 --- a/helm/minio/templates/ingress.yaml +++ b/helm/minio/templates/ingress.yaml @@ -32,6 +32,7 @@ spec: {{- end }} {{- end }} rules: + {{- $domain := include "minio.domain" . -}} {{- range .Values.ingress.hosts }} - http: paths: @@ -41,7 +42,7 @@ spec: backend: service: name: {{ $fullName }} - port: + port: number: {{ $servicePort }} {{- else }} backend: @@ -49,7 +50,9 @@ spec: servicePort: {{ $servicePort }} {{- end }} {{- if . }} - host: {{ tpl . $ | quote }} + {{- $host := . }} + {{- $hostWithDomain := printf "%s%s" $host $domain }} + host: {{ $hostWithDomain | quote }} {{- end }} {{- end }} {{- end }} diff --git a/helm/minio/values.yaml b/helm/minio/values.yaml index 4c9714ea9..e659863fb 100644 --- a/helm/minio/values.yaml +++ b/helm/minio/values.yaml @@ -591,3 +591,6 @@ etcd: corednsPathPrefix: "" clientCert: "" clientCertKey: "" +## Provide a domain to happend at the end of every host specified in the ingress hosts value +## +domain: '' From d1d40f0972235c40f306aa9555e0722005fc2139 Mon Sep 17 00:00:00 2001 From: ideal-respectable-trumpet Date: Thu, 17 Apr 2025 08:45:08 +0200 Subject: [PATCH 2/2] Fixed typo --- helm/minio/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/helm/minio/values.yaml b/helm/minio/values.yaml index e659863fb..fd6d5ac8e 100644 --- a/helm/minio/values.yaml +++ b/helm/minio/values.yaml @@ -591,6 +591,6 @@ etcd: corednsPathPrefix: "" clientCert: "" clientCertKey: "" -## Provide a domain to happend at the end of every host specified in the ingress hosts value +## Provide a domain to append at the end of every host specified in the ingress hosts value ## domain: ''