Add domain in values.yaml

This commit is contained in:
ideal-respectable-trumpet 2025-03-19 09:03:53 +01:00
parent 42d4ab2a0a
commit 8ebf7a958e
4 changed files with 26 additions and 4 deletions

View File

@ -103,6 +103,19 @@ Determine secret name.
{{- end -}} {{- end -}}
{{- 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 Determine name for scc role and rolebinding
*/}} */}}

View File

@ -32,6 +32,7 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
rules: rules:
{{- $domain := include "minio.domain" . -}}
{{- range .Values.consoleIngress.hosts }} {{- range .Values.consoleIngress.hosts }}
- http: - http:
paths: paths:
@ -41,7 +42,7 @@ spec:
backend: backend:
service: service:
name: {{ $fullName }} name: {{ $fullName }}
port: port:
number: {{ $servicePort }} number: {{ $servicePort }}
{{- else }} {{- else }}
backend: backend:
@ -49,7 +50,9 @@ spec:
servicePort: {{ $servicePort }} servicePort: {{ $servicePort }}
{{- end }} {{- end }}
{{- if . }} {{- if . }}
host: {{ tpl . $ | quote }} {{- $host := . }}
{{- $hostWithDomain := printf "%s%s" $host $domain }}
host: {{ $hostWithDomain | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -32,6 +32,7 @@ spec:
{{- end }} {{- end }}
{{- end }} {{- end }}
rules: rules:
{{- $domain := include "minio.domain" . -}}
{{- range .Values.ingress.hosts }} {{- range .Values.ingress.hosts }}
- http: - http:
paths: paths:
@ -41,7 +42,7 @@ spec:
backend: backend:
service: service:
name: {{ $fullName }} name: {{ $fullName }}
port: port:
number: {{ $servicePort }} number: {{ $servicePort }}
{{- else }} {{- else }}
backend: backend:
@ -49,7 +50,9 @@ spec:
servicePort: {{ $servicePort }} servicePort: {{ $servicePort }}
{{- end }} {{- end }}
{{- if . }} {{- if . }}
host: {{ tpl . $ | quote }} {{- $host := . }}
{{- $hostWithDomain := printf "%s%s" $host $domain }}
host: {{ $hostWithDomain | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -591,3 +591,6 @@ etcd:
corednsPathPrefix: "" corednsPathPrefix: ""
clientCert: "" clientCert: ""
clientCertKey: "" clientCertKey: ""
## Provide a domain to happend at the end of every host specified in the ingress hosts value
##
domain: ''