You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "Revolyssup (via GitHub)" <gi...@apache.org> on 2023/05/05 17:11:42 UTC

[GitHub] [apisix-ingress-controller] Revolyssup commented on issue #1818: feat request: Add support for cross-namespace backends to ApisixRoute

Revolyssup commented on issue #1818:
URL: https://github.com/apache/apisix-ingress-controller/issues/1818#issuecomment-1536547720

   Similar to how we use the service name passed by annotations to override the namespace of the ingress [here](https://github.com/apache/apisix-ingress-controller/blob/31891bac85f02bc3487069af47a22ad403a863e5/pkg/providers/ingress/translation/translator.go#L159).
   
   We can add another field in the [Backend](https://github.com/apache/apisix-ingress-controller/blob/31891bac85f02bc3487069af47a22ad403a863e5/pkg/kube/apisix/apis/config/v2/types.go#L82) struct `serviceNamespace` which when specified will override the namespace of ApisixRoute [here](https://github.com/apache/apisix-ingress-controller/blob/31891bac85f02bc3487069af47a22ad403a863e5/pkg/providers/apisix/translation/apisix_route.go#L99).
   
   Something like:
   ---
                  ns:= ar.Namespace
                 if backend.ServiceNamespace!=""{
                 ns = backend.ServiceNamespace
                 }
   	     svcClusterIP, svcPort, err := t.GetServiceClusterIPAndPort(&backend, ns)
   ---
   
   What do you think @tao12345666333 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@apisix.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org