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: ''