diff --git a/lib/srv/alpnproxy/kube.go b/lib/srv/alpnproxy/kube.go index 93d6893595aa0..20018ecfb5a5a 100644 --- a/lib/srv/alpnproxy/kube.go +++ b/lib/srv/alpnproxy/kube.go @@ -240,7 +240,12 @@ func (m *KubeMiddleware) reissueCertIfExpired(ctx context.Context, cert tls.Cert if m.isCertReissuingRunning.CompareAndSwap(false, true) { go func() { defer m.isCertReissuingRunning.Store(false) - newCert, err := m.certReissuer(context.Background(), identity.TeleportCluster, identity.KubernetesCluster) + + cluster := identity.TeleportCluster + if identity.RouteToCluster != "" { + cluster = identity.RouteToCluster + } + newCert, err := m.certReissuer(ctx, cluster, identity.KubernetesCluster) if err == nil { m.certsMu.Lock() m.certs[serverName] = newCert