diff --git a/internal/ingress/controller/controller.go b/internal/ingress/controller/controller.go index ff8a3b7d7..fd297a1ee 100644 --- a/internal/ingress/controller/controller.go +++ b/internal/ingress/controller/controller.go @@ -343,6 +343,7 @@ func (n *NGINXController) getStreamServices(configmapName string, proto apiv1.Pr ProxyProtocol: svcProxyProtocol, }, Endpoints: endps, + Service: svc, }) } // Keep upstream order sorted to reduce unnecessary nginx config reloads. diff --git a/internal/ingress/controller/nginx.go b/internal/ingress/controller/nginx.go index 46725b5c7..85c77b44b 100644 --- a/internal/ingress/controller/nginx.go +++ b/internal/ingress/controller/nginx.go @@ -821,6 +821,7 @@ func configureDynamically(pcfg *ingress.Configuration, port int, isDynamicCertif Name: key, Endpoints: ep.Endpoints, Port: intstr.FromInt(ep.Port), + Service: ep.Service, }) } for _, ep := range pcfg.UDPEndpoints { @@ -829,6 +830,7 @@ func configureDynamically(pcfg *ingress.Configuration, port int, isDynamicCertif Name: key, Endpoints: ep.Endpoints, Port: intstr.FromInt(ep.Port), + Service: ep.Service, }) } diff --git a/internal/ingress/types.go b/internal/ingress/types.go index c70a5526f..14f1dfd24 100644 --- a/internal/ingress/types.go +++ b/internal/ingress/types.go @@ -322,6 +322,8 @@ type L4Service struct { Backend L4Backend `json:"backend"` // Endpoints active endpoints of the service Endpoints []Endpoint `json:"endpoints,omitempty"` + // k8s Service + Service *apiv1.Service `json:"service,omitempty"` } // L4Backend describes the kubernetes service behind L4 Ingress service