You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by "carefree666 (via GitHub)" <gi...@apache.org> on 2025/12/02 07:25:46 UTC

[I] request help: What is the recommended way to proxy TCP traffic for Services in other namespaces? [apisix-ingress-controller]

carefree666 opened a new issue, #2668:
URL: https://github.com/apache/apisix-ingress-controller/issues/2668

   ### Issue description
   
   I’m trying to expose TCP Services that are located in a different namespace from APISIX.
   TCP routing works when the backend Service is in the same namespace as the ApisixRoute, but fails when the Service is in another namespace.
   
   Question:
   What is the recommended or officially supported way to proxy TCP (stream) traffic to Kubernetes Services located in other namespaces?
   
   ### Environment
   
   - your apisix-ingress-controller version (output of apisix-ingress-controller version --long):
   - your Kubernetes cluster version (output of kubectl version):
   - if you run apisix-ingress-controller in Bare-metal environment, also show your OS version (uname -a):
   


-- 
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.apache.org

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


Re: [I] request help: What is the recommended way to proxy TCP traffic for Services in other namespaces? [apisix-ingress-controller]

Posted by "carefree666 (via GitHub)" <gi...@apache.org>.
carefree666 commented on issue #2668:
URL: https://github.com/apache/apisix-ingress-controller/issues/2668#issuecomment-3604795631

   > The `ApisixRoute` does not support cross namespace
   
   Hi šŸ‘‹, thanks for your reply! I would like to ask if there is a specific method or documentation example for exposing TCP services in other namespaces. I’m encountering some issues when trying to expose TCP services across namespaces, so having a concrete example or step-by-step guide would be really helpful. Thanks!


-- 
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


Re: [I] request help: What is the recommended way to proxy TCP traffic for Services in other namespaces? [apisix-ingress-controller]

Posted by "AlinsRan (via GitHub)" <gi...@apache.org>.
AlinsRan commented on issue #2668:
URL: https://github.com/apache/apisix-ingress-controller/issues/2668#issuecomment-3605637777

   > Hi šŸ‘‹, thanks for your reply! I would like to ask if there is a specific method or documentation example for exposing TCP services in other namespaces. I’m encountering some issues when trying to expose TCP services across namespaces, so having a concrete example or step-by-step guide would be really helpful. Thanks!
   
   Perhaps we can use ExternalName's service to bypass it?
   ```yaml
   apiVersion: v1
   kind: Service
   metadata:
     namespace: v1
     name: tcp-server-proxy
   spec:
     type: ExternalName
     externalName: tcp-service-backend.v2.svc
   ```
   
   


-- 
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


Re: [I] request help: What is the recommended way to proxy TCP traffic for Services in other namespaces? [apisix-ingress-controller]

Posted by "huangyutongs (via GitHub)" <gi...@apache.org>.
huangyutongs commented on issue #2668:
URL: https://github.com/apache/apisix-ingress-controller/issues/2668#issuecomment-3668944924

   Apisix Supports using `tcp-route` to proxy TCP traffic.
   https://apisix.apache.org/docs/ingress-controller/1.8.0/concepts/apisix_route/#tcp-route
   
   but
   The ingressPort (9100 here) should be pre-defined in the [APISIX configuration](https://github.com/apache/apisix/blob/master/conf/config.yaml.example#L76).
   
   This means I would need to modify the APISIX configuration file and restart APISIX. Restarting APISIX in a production environment would result in some traffic loss, which forced me to abandon using APISIX to proxy TCP traffic.
   
   Currently, I'm using ingress-nginx in hostnetwork mode to configure dynamic TCP proxying.  With just one line of code, ingress-nginx can listen on a port and proxy to the corresponding service.
   ```
   apiVersion: v1
   kind: ConfigMap
   metadata:
   name: ingress-nginx-tcp
   data:
   "9090": monitoring/prometheus-service:9090
   ```
   
   Due to the upcoming deprecation of ingress-nginx, I switched to using ingress-haproxy, which performs just as well as ingress-controller.


-- 
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


Re: [I] request help: What is the recommended way to proxy TCP traffic for Services in other namespaces? [apisix-ingress-controller]

Posted by "carefree666 (via GitHub)" <gi...@apache.org>.
carefree666 commented on issue #2668:
URL: https://github.com/apache/apisix-ingress-controller/issues/2668#issuecomment-3605665779

   > > Hi šŸ‘‹, thanks for your reply! I would like to ask if there is a specific method or documentation example for exposing TCP services in other namespaces. I’m encountering some issues when trying to expose TCP services across namespaces, so having a concrete example or step-by-step guide would be really helpful. Thanks!
   > 
   > Perhaps we can use ExternalName's service to bypass it?
   > 
   > apiVersion: v1
   > kind: Service
   > metadata:
   >   namespace: v1
   >   name: tcp-server-proxy
   > spec:
   >   type: ExternalName
   >   externalName: tcp-service-backend.v2.svc
   
   This is indeed how I'm currently implementing it, but I want to confirm if this approach is the optimal one


-- 
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


Re: [I] request help: What is the recommended way to proxy TCP traffic for Services in other namespaces? [apisix-ingress-controller]

Posted by "carefree666 (via GitHub)" <gi...@apache.org>.
carefree666 closed issue #2668: request help: What is the recommended way to proxy TCP traffic for Services in other namespaces?
URL: https://github.com/apache/apisix-ingress-controller/issues/2668


-- 
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