feat(traefik): add support for proxyProtocol (#3593)
* feat(traefik): add support for proxyProtocol * whoops * empty space * proxyprot on all entrypoints * whoops again * no fixes here * Update charts/stable/traefik/templates/_args.tpl * formatting Co-authored-by: Kjeld Schouten-Lebbing <kjeld@schouten-lebbing.nl>
This commit is contained in:
co-authored by
Kjeld Schouten-Lebbing
parent
857b0a8302
commit
274c522df6
@@ -23,7 +23,7 @@ sources:
|
||||
- https://github.com/traefik/traefik-helm-chart
|
||||
- https://traefik.io/
|
||||
type: application
|
||||
version: 13.2.3
|
||||
version: 13.3.0
|
||||
annotations:
|
||||
truecharts.org/catagories: |
|
||||
- network
|
||||
|
||||
@@ -605,36 +605,8 @@ questions:
|
||||
schema:
|
||||
type: string
|
||||
default: "websecure"
|
||||
- variable: forwardedHeaders
|
||||
label: "Accept Forwarded Headers"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: enabled
|
||||
label: "Enable"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: trustedIPs
|
||||
label: "Trusted IPs"
|
||||
schema:
|
||||
type: list
|
||||
default: []
|
||||
items:
|
||||
- variable: trustedIPsEntry
|
||||
label: ""
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: insecureMode
|
||||
label: "Insecure Mode"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
# Include{forwardedHeaders}
|
||||
# Include{proxyProtocol}
|
||||
- variable: websecure
|
||||
label: "websecure Entrypoints Configuration"
|
||||
schema:
|
||||
@@ -661,36 +633,8 @@ questions:
|
||||
label: "Redirect to Entrypoint"
|
||||
schema:
|
||||
type: string
|
||||
- variable: forwardedHeaders
|
||||
label: "Accept Forwarded Headers"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: enabled
|
||||
label: "Enable"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: trustedIPs
|
||||
label: "Trusted IPs"
|
||||
schema:
|
||||
type: list
|
||||
default: []
|
||||
items:
|
||||
- variable: trustedIPsEntry
|
||||
label: ""
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: insecureMode
|
||||
label: "Insecure Mode"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
# Include{forwardedHeaders}
|
||||
# Include{proxyProtocol}
|
||||
- variable: tls
|
||||
label: "websecure Entrypoints Configuration"
|
||||
schema:
|
||||
@@ -763,36 +707,8 @@ questions:
|
||||
label: "Redirect to Entrypoint"
|
||||
schema:
|
||||
type: string
|
||||
- variable: forwardedHeaders
|
||||
label: "Accept Forwarded Headers"
|
||||
schema:
|
||||
additional_attrs: true
|
||||
type: dict
|
||||
attrs:
|
||||
- variable: enabled
|
||||
label: "Enable"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
show_subquestions_if: true
|
||||
subquestions:
|
||||
- variable: trustedIPs
|
||||
label: "Trusted IPs"
|
||||
schema:
|
||||
type: list
|
||||
default: []
|
||||
items:
|
||||
- variable: trustedIPsEntry
|
||||
label: ""
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: insecureMode
|
||||
label: "Insecure Mode"
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
# Include{forwardedHeaders}
|
||||
# Include{proxyProtocol}
|
||||
# Include{ingressRoot}
|
||||
- variable: main
|
||||
label: "Main Ingress"
|
||||
|
||||
@@ -67,6 +67,17 @@ args:
|
||||
- "--providers.kubernetesingress.ingressclass={{ .Release.Name }}"
|
||||
{{- end }}
|
||||
{{- range $entrypoint, $config := $ports }}
|
||||
{{/* add args for proxyProtocol support */}}
|
||||
{{- if $config.proxyProtocol }}
|
||||
{{- if $config.proxyProtocol.enabled }}
|
||||
{{- if $config.proxyProtocol.insecureMode }}
|
||||
- "--entrypoints.{{ $entrypoint }}.proxyProtocol.insecure"
|
||||
{{- end }}
|
||||
{{- if not ( empty $config.proxyProtocol.trustedIPs ) }}
|
||||
- "--entrypoints.{{ $entrypoint }}.proxyProtocol.trustedIPs={{ join "," $config.proxyProtocol.trustedIPs }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{/* add args for forwardedHeaders support */}}
|
||||
{{- if $config.forwardedHeaders.enabled }}
|
||||
{{- if not ( empty $config.forwardedHeaders.trustedIPs ) }}
|
||||
|
||||
@@ -152,6 +152,9 @@ service:
|
||||
# -- Forwarded Headers should never be enabled on Main entrypoint
|
||||
forwardedHeaders:
|
||||
enabled: false
|
||||
# -- Proxy Protocol should never be enabled on Main entrypoint
|
||||
proxyProtocol:
|
||||
enabled: false
|
||||
tcp:
|
||||
enabled: true
|
||||
type: LoadBalancer
|
||||
@@ -161,6 +164,8 @@ service:
|
||||
port: 9080
|
||||
protocol: HTTP
|
||||
redirectTo: websecure
|
||||
# Options: Empty, 0 (ingore), or positive int
|
||||
# redirectPort:
|
||||
# -- Configure (Forwarded Headers)[https://doc.traefik.io/traefik/routing/entrypoints/#forwarded-headers] Support
|
||||
forwardedHeaders:
|
||||
enabled: false
|
||||
@@ -168,8 +173,13 @@ service:
|
||||
trustedIPs: []
|
||||
# -- Trust all forwarded headers
|
||||
insecureMode: false
|
||||
# Options: Empty, 0 (ingore), or positive int
|
||||
# redirectPort:
|
||||
# -- Configure (Proxy Protocol Headers)[https://doc.traefik.io/traefik/routing/entrypoints/#proxyprotocol] Support
|
||||
proxyProtocol:
|
||||
enabled: false
|
||||
# -- Only IPs in trustedIPs will lead to remote client address replacement
|
||||
trustedIPs: []
|
||||
# -- Trust every incoming connection
|
||||
insecureMode: false
|
||||
websecure:
|
||||
enabled: true
|
||||
port: 9443
|
||||
@@ -181,6 +191,13 @@ service:
|
||||
trustedIPs: []
|
||||
# -- Trust all forwarded headers
|
||||
insecureMode: false
|
||||
# -- Configure (Proxy Protocol Headers)[https://doc.traefik.io/traefik/routing/entrypoints/#proxyprotocol] Support
|
||||
proxyProtocol:
|
||||
enabled: false
|
||||
# -- Only IPs in trustedIPs will lead to remote client address replacement
|
||||
trustedIPs: []
|
||||
# -- Trust every incoming connection
|
||||
insecureMode: false
|
||||
# tcpexample:
|
||||
# enabled: true
|
||||
# targetPort: 9443
|
||||
@@ -207,6 +224,9 @@ service:
|
||||
# -- Forwarded Headers should never be enabled on Metrics entrypoint
|
||||
forwardedHeaders:
|
||||
enabled: false
|
||||
# -- Proxy Protocol should never be enabled on Metrics entrypoint
|
||||
proxyProtocol:
|
||||
enabled: false
|
||||
udp:
|
||||
enabled: false
|
||||
|
||||
@@ -328,7 +348,7 @@ middlewares:
|
||||
redirectRegex: []
|
||||
# - name: redirectRegexName
|
||||
# regex: putregexhere
|
||||
# replacement: repslacementurlhere
|
||||
# replacement: replacementurlhere
|
||||
# permanent: false
|
||||
stripPrefixRegex: []
|
||||
# - name: stripPrefixRegexName
|
||||
|
||||
Reference in New Issue
Block a user