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
@@ -276,6 +276,16 @@ include_questions(){
|
||||
/# Include{documentation}/ { for (i=0;i<n;++i) print a[i]; next }
|
||||
1' templates/questions/documentation.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
|
||||
|
||||
# Replace # Include{[forwardedHeaders]} with the standard forwardedHeaders codesnippet
|
||||
awk 'NR==FNR { a[n++]=$0; next }
|
||||
/# Include{forwardedHeaders}/ { for (i=0;i<n;++i) print a[i]; next }
|
||||
1' templates/questions/traefik/forwardedHeaders.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
|
||||
|
||||
# Replace # Include{proxyProtocol} with the standard proxyProtocol codesnippet
|
||||
awk 'NR==FNR { a[n++]=$0; next }
|
||||
/# Include{proxyProtocol}/ { for (i=0;i<n;++i) print a[i]; next }
|
||||
1' templates/questions/traefik/proxyProtocol.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
|
||||
|
||||
}
|
||||
export -f include_questions
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4,20 +4,25 @@ words:
|
||||
- allowtransparency
|
||||
- APITOKEN
|
||||
- appname
|
||||
- appnamehere
|
||||
- Authentik
|
||||
- Authexample
|
||||
- authkey
|
||||
- autoconnect
|
||||
- AUTOSYNC
|
||||
- backupname
|
||||
- basicauthexample
|
||||
- bazarr
|
||||
- bugfixer's
|
||||
- bungeecord
|
||||
- chainname
|
||||
- cheatsheet
|
||||
- cloudflared
|
||||
- Cloudflareddns
|
||||
- collabora
|
||||
- configfile
|
||||
- configmap
|
||||
- containo
|
||||
- daemonset
|
||||
- dbcreds
|
||||
- dbengine
|
||||
@@ -27,6 +32,7 @@ words:
|
||||
- dockerized
|
||||
- duplicati
|
||||
- dynmap
|
||||
- Entrypoints
|
||||
- eptgmk
|
||||
- Fireshare
|
||||
- fullname
|
||||
@@ -39,6 +45,10 @@ words:
|
||||
- hyperconverged
|
||||
- hyperthread
|
||||
- iban
|
||||
- ingressclasses
|
||||
- ingressroutes
|
||||
- ingressroutetcps
|
||||
- ingressrouteudps
|
||||
- integrationsenabled
|
||||
- ipaddr
|
||||
- ixcert
|
||||
@@ -66,6 +76,8 @@ words:
|
||||
- mediafiles
|
||||
- meshroom
|
||||
- metallb
|
||||
- middlewares
|
||||
- middlewaretcps
|
||||
- Mikrotik
|
||||
- milicpu
|
||||
- minecraft
|
||||
@@ -94,6 +106,7 @@ words:
|
||||
- Preload
|
||||
- proto
|
||||
- puid
|
||||
- putregexhere
|
||||
- pvcname
|
||||
- pvcpath
|
||||
- quotum
|
||||
@@ -105,11 +118,13 @@ words:
|
||||
- RECORDTYPES
|
||||
- registeringats
|
||||
- reneg
|
||||
- replacementurlhere
|
||||
- resolv
|
||||
- sabnzbd
|
||||
- schouten
|
||||
- selfsigned
|
||||
- SERVERCONFIG
|
||||
- serverstransports
|
||||
- serviceexpert
|
||||
- smallblock
|
||||
- sonarr
|
||||
@@ -131,7 +146,13 @@ words:
|
||||
- targetport
|
||||
- tccr
|
||||
- teamspeak
|
||||
- testpassword
|
||||
- testuser
|
||||
- themenamehere
|
||||
- tlsoptions
|
||||
- tlsstores
|
||||
- traefik
|
||||
- traefikservices
|
||||
- truecharts
|
||||
- truenas
|
||||
- truetool
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
- 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
|
||||
description: Trust Forwarded Headers from specific IPs.
|
||||
schema:
|
||||
type: list
|
||||
default: []
|
||||
items:
|
||||
- variable: trustedIPsEntry
|
||||
label: ""
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: insecureMode
|
||||
label: Insecure Mode
|
||||
description: Always Trust Forwarded Headers
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -0,0 +1,33 @@
|
||||
- variable: proxyProtocol
|
||||
label: Accept Proxy Protocol connections
|
||||
description: If Proxy Protocol header parsing is enabled for the entry point, this entry point can accept connections with or without Proxy Protocol 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
|
||||
description: Only IPs in trustedIPs will lead to remote client address replacement
|
||||
schema:
|
||||
type: list
|
||||
default: []
|
||||
items:
|
||||
- variable: trustedIPsEntry
|
||||
label: ""
|
||||
schema:
|
||||
type: string
|
||||
required: true
|
||||
default: ""
|
||||
- variable: insecureMode
|
||||
label: Insecure Mode
|
||||
description: Trust every incoming connection
|
||||
schema:
|
||||
type: boolean
|
||||
default: false
|
||||
@@ -368,6 +368,16 @@ include_questions(){
|
||||
/# Include{documentation}/ { for (i=0;i<n;++i) print a[i]; next }
|
||||
1' templates/questions/documentation.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
|
||||
|
||||
# Replace # Include{[forwardedHeaders]} with the standard forwardedHeaders codesnippet
|
||||
awk 'NR==FNR { a[n++]=$0; next }
|
||||
/# Include{forwardedHeaders}/ { for (i=0;i<n;++i) print a[i]; next }
|
||||
1' templates/questions/traefik/forwardedHeaders.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
|
||||
|
||||
# Replace # Include{proxyProtocol} with the standard proxyProtocol codesnippet
|
||||
awk 'NR==FNR { a[n++]=$0; next }
|
||||
/# Include{proxyProtocol}/ { for (i=0;i<n;++i) print a[i]; next }
|
||||
1' templates/questions/traefik/proxyProtocol.yaml ${target}/questions.yaml > "tmp${chartname}" && mv "tmp${chartname}" ${target}/questions.yaml
|
||||
|
||||
}
|
||||
export -f include_questions
|
||||
|
||||
|
||||
Reference in New Issue
Block a user