diff --git a/pkg/agent/manager/gatewayapi/httproute.go b/pkg/agent/manager/gatewayapi/httproute.go index 44e98bf..efd3a26 100644 --- a/pkg/agent/manager/gatewayapi/httproute.go +++ b/pkg/agent/manager/gatewayapi/httproute.go @@ -296,7 +296,7 @@ func (h *HTTPRouteManager) createIngress(ctx context.Context, httpRoute *v1.HTTP newIngress.SetLabels(map[string]string{ "implementation": implementation, }) - ingressClass := "loxilb.io/loxilb" + ingressClass := "loxilb" newIngress.Spec.IngressClassName = &ingressClass // If the listener has a hostname, it takes precedence over httpRoute. @@ -327,6 +327,13 @@ func (h *HTTPRouteManager) createIngress(ctx context.Context, httpRoute *v1.HTTP for _, match := range rule.Matches { for _, backref := range rule.BackendRefs { + if backref.Namespace != nil { + if newIngress.Namespace != string(*backref.Namespace) { + newIngress.Annotations["external-backend-service"] = "true" + newIngress.Annotations["service-"+string(backref.Name)+"-namespace"] = string(*backref.Namespace) + } + } + newIngressPath := netv1.HTTPIngressPath{ Backend: netv1.IngressBackend{ Service: &netv1.IngressServiceBackend{