diff --git a/lib/srv/alpnproxy/kube.go b/lib/srv/alpnproxy/kube.go index c1939b74dc2fe..10bec7fcab7c0 100644 --- a/lib/srv/alpnproxy/kube.go +++ b/lib/srv/alpnproxy/kube.go @@ -237,7 +237,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(context.Background(), cluster, identity.KubernetesCluster) if err == nil { m.certsMu.Lock() m.certs[serverName] = newCert