diff --git a/charts/application/templates/_helpers.tpl b/charts/application/templates/_helpers.tpl index 482b5eb..70fc39c 100644 --- a/charts/application/templates/_helpers.tpl +++ b/charts/application/templates/_helpers.tpl @@ -51,4 +51,11 @@ Returns string "true" or empty which will be evaluated to boolean false {{- if or .Values.authOnly (and .Values.auth.enabled .Values.auth.create (include "ingressRoute.create" .)) }} {{- true }} {{- end }} +{{- end }} + +{{/* +Return default auth host or custom value if set +*/}} +{{- define "auth.host" -}} +{{ .Values.auth.host | default (print "auth-" .Values.namespace "." .Values.auth.cookieDomain ) }} {{- end }} \ No newline at end of file diff --git a/charts/application/templates/ingress-route.yaml b/charts/application/templates/ingress-route.yaml index b20aa19..9227135 100644 --- a/charts/application/templates/ingress-route.yaml +++ b/charts/application/templates/ingress-route.yaml @@ -24,7 +24,7 @@ spec: {{- end }} {{- end }} {{- if include "auth.create" . }} - - match: Host(`{{ .Values.auth.host }}.stonegarden.dev`) + - match: Host(`{{ include "auth.host" . }}`) kind: Rule services: - name: traefik-forward-auth diff --git a/charts/application/templates/traefik-forward-auth/config-map.yaml b/charts/application/templates/traefik-forward-auth/config-map.yaml index 7115d95..4f9b40d 100644 --- a/charts/application/templates/traefik-forward-auth/config-map.yaml +++ b/charts/application/templates/traefik-forward-auth/config-map.yaml @@ -13,8 +13,8 @@ data: traefik-forward-auth.ini: |- cookie-name = {{ .Values.auth.cookieName | default (print "_" .Values.namespace "_auth") | quote }} cookie-domain = {{ .Values.auth.cookieDomain | quote }} - auth-host = {{ .Values.auth.host | default (print "auth-" .Values.namespace "." .Values.auth.cookieDomain ) | quote}} - log-level = {{ .Values.auth.logLevel | quote}} + auth-host = {{ include "auth.host" . | quote }} + log-level = {{ .Values.auth.logLevel | quote }} {{- range .Values.auth.domains }} domain = {{ . | quote }} {{- end }}