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