Skip to content

Commit

Permalink
Fix proxy protocol support for Kube access flow (#29268)
Browse files Browse the repository at this point in the history
This PR allows enabling/disabling the support for proxy protocol in Kubernetes access flow.
  • Loading branch information
tigrato committed Jul 18, 2023
1 parent 30c7046 commit 6f2887d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion lib/kube/proxy/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ type TLSServerConfig struct {
CloudLabels labels.Importer
// IngressReporter reports new and active connections.
IngressReporter *ingress.Reporter
// EnableProxyProtocol enables proxy protocol support
EnableProxyProtocol bool
}

// CheckAndSetDefaults checks and sets default values
Expand Down Expand Up @@ -242,7 +244,7 @@ func (t *TLSServer) Serve(listener net.Listener) error {
Context: t.Context,
Listener: listener,
Clock: t.Clock,
EnableProxyProtocol: true,
EnableProxyProtocol: t.EnableProxyProtocol,
ID: t.Component,
// Increases deadline until the agent receives the first byte to 10s.
// It's required to accommodate setups with high latency and where the time
Expand Down
15 changes: 8 additions & 7 deletions lib/service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -3817,13 +3817,14 @@ func (process *TeleportProcess) initProxyEndpoint(conn *Connector) error {
LockWatcher: lockWatcher,
CheckImpersonationPermissions: cfg.Kube.CheckImpersonationPermissions,
},
TLS: tlsConfig,
LimiterConfig: cfg.Proxy.Limiter,
AccessPoint: accessPoint,
GetRotation: process.getRotation,
OnHeartbeat: process.onHeartbeat(component),
Log: log,
IngressReporter: ingressReporter,
TLS: tlsConfig,
LimiterConfig: cfg.Proxy.Limiter,
AccessPoint: accessPoint,
GetRotation: process.getRotation,
OnHeartbeat: process.onHeartbeat(component),
Log: log,
IngressReporter: ingressReporter,
EnableProxyProtocol: cfg.Proxy.EnableProxyProtocol,
})
if err != nil {
return trace.Wrap(err)
Expand Down

0 comments on commit 6f2887d

Please sign in to comment.