Update templates/traefik.yaml
This commit is contained in:
parent
462ae64b0f
commit
489e31d7f0
@ -15,7 +15,14 @@ spec:
|
||||
- name: {{ .Values.expose.service.name }}
|
||||
port: {{ .Values.expose.service.port }}
|
||||
namespace: {{ .Values.namespace }}
|
||||
{{ if has "authentik" .Values.expose.middlewares }}
|
||||
|
||||
{{- $authentikMiddleware := false }}
|
||||
{{- range .Values.expose.middlewares }}
|
||||
{{- if eq .name "authentik" }}
|
||||
{{- $authentikMiddleware = true }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if $authentikMiddleware }}
|
||||
---
|
||||
apiVersion: traefik.io/v1alpha1
|
||||
kind: Middleware
|
||||
@ -26,7 +33,7 @@ spec:
|
||||
forwardAuth:
|
||||
{{- $regexArray := mustRegexFindAll "Host[(]`[^`]+`[)]" .Values.expose.match -1 }}
|
||||
{{- $firstHost := index $regexArray 0 }}
|
||||
{{- $hostname := regexReplaceAll ".+`([^`]+)`.+" $firstHost "$1"}}
|
||||
{{- $hostname := regexReplaceAll ".+`([^`]+)`.?" $firstHost "$1"}}
|
||||
address: https://{{ $hostname }}/outpost.goauthentik.io/auth/traefik
|
||||
authResponseHeaders:
|
||||
- X-authentik-username
|
||||
@ -41,4 +48,4 @@ spec:
|
||||
- X-authentik-meta-app
|
||||
- X-authentik-meta-version
|
||||
trustForwardHeader: true
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
Loading…
x
Reference in New Issue
Block a user