Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v13] Fix proxy protocol support for Kube access flow #29274

Merged
merged 1 commit into from Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/kube/proxy/server.go
Expand Up @@ -89,6 +89,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 @@ -258,7 +260,7 @@ func (t *TLSServer) Serve(listener net.Listener) error {
Context: t.Context,
Listener: listener,
Clock: t.Clock,
EnableExternalProxyProtocol: true,
EnableExternalProxyProtocol: t.EnableProxyProtocol,
ID: t.Component,
CertAuthorityGetter: caGetter,
LocalClusterName: t.ClusterName,
Expand Down
15 changes: 8 additions & 7 deletions lib/service/service.go
Expand Up @@ -4213,13 +4213,14 @@ func (process *TeleportProcess) initProxyEndpoint(conn *Connector) error {
ConnTLSConfig: tlsConfig.Clone(),
ClusterFeatures: process.getClusterFeatures,
},
TLS: tlsConfig.Clone(),
LimiterConfig: cfg.Proxy.Limiter,
AccessPoint: accessPoint,
GetRotation: process.GetRotation,
OnHeartbeat: process.OnHeartbeat(component),
Log: log,
IngressReporter: ingressReporter,
TLS: tlsConfig.Clone(),
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