Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP Support? #164

Closed
hapnermw opened this issue Aug 6, 2017 · 8 comments
Closed

TCP Support? #164

hapnermw opened this issue Aug 6, 2017 · 8 comments
Labels
enhancement Pull requests for new features/feature enhancements

Comments

@hapnermw
Copy link

hapnermw commented Aug 6, 2017

The current ingress resource doesn't support TCP services. It's likely to support this later; but, for now there needs to be some lower-level/controller-specific way of doing this.

Is there an undocumented way to provide ingress to TCP services.

If not, is there any ongoing development on a work-around for this. Ideally it would be a controller specific annotation and/or configmap that will allow dynamic deployment of TCP services via an ingress resource.

Currently, the kubernetes nginx-ingress-controller provides a work-around for staticly specifying TCP services; however, this isn't very useful for dynamic deployment of services (which is the whole purpose of the ingress facility).

@pleshakov
Copy link
Contributor

@hapnermw
there is no undocumented way to provide Ingress for TCP services and there are no plans to add it in the nearest future.

Why doesn't the config map approach of the nginx-ingress-controller work you? Not sure If completely understand the distinction between static and dynamic deployments in your example.

@hapnermw
Copy link
Author

hapnermw commented Aug 7, 2017

The reason k8s added the ingress abstraction is to support the dynamic registration of virtual hosts (virtual servers) for services (via HTTP hostname or TLS SNI).

NginX's ingress controller supports this by dynamically discovering k8s ingress resources and configuring HTTP virtual servers for them.

NginX has supported TLS/TCP virtual servers for some time. They do TLS/TCP session load balancing and require different configuration. The NginX k8s ingress controller does not support this NginX feature because currently k8s ingress does not support it.

This is unfortunate because it wouldn't have been difficult to include syntax for TCP ingress and simply note that support for this was optional. By not including this, k8s has blocked ingress controllers from supporting it.

@julienvincent
Copy link

@pleshakov I am trying to use the ConfigMap approach but with little success. I am using the following yml (on GKE):

apiVersion: v1
kind: ConfigMap
metadata:
  namespace: ingress-nginx
  name: tcp-services
data:
  2000: "lb-test/lb-tcp-headless:2000"

This does not seem to have any effect and I am still unable to connect to the server via port 2000. Not sure if I am miss-understanding something here?

@pleshakov
Copy link
Contributor

@hapnermw load balancing TCP/UDP is available through https://github.com/kubernetes/ingress-nginx/ Ingress controller

@totemcaf
Copy link

@julienvincent We found that the configmap approach configures correctly the nginx but you are not able to access that port because the Service for the nginx is not modified. To be able to access the port a new port is needed to be added in the Service to open that port in the LoadBalancer and in the Service ports.

I have the question if this reconfiguration of the Neginx Service should be done by hand or it is expected to be done by the ngonx-controller module.

@julienvincent
Copy link

@totemcaf Yes I came to the same conclusion when I was working on this problem. Either way this is the wrong repository to be discussing this on (my bad for discussing an ingress-nginx issue on this thread)

@isaachawley isaachawley added the enhancement Pull requests for new features/feature enhancements label Jul 30, 2018
@kurktchiev
Copy link

This is still needed though, unfortunately the LoadBalancer object is not really useful to anyone that doesnt live in the cloud, and Ingress does offer the best approach to get non HTTP traffic LBed. DBs and any other non HTTP traffic still needs to be able to be routed and Nginx is being used to do that right now in many an enterprise but unfortunately we are unable to do so in Kube :(

Shouldnt a simple annotation that lets us add the endpoints to watch be sufficient for at least a starting point for this?

@pleshakov
Copy link
Contributor

@ebalsumgo
we recently added support for stream-snippets in #340 this allows to add TCP/UDP NGINX configuration to NGINX Ingress Controller. Please take a look at https://github.com/nginxinc/kubernetes-ingress/tree/master/examples/tcp-udp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

No branches or pull requests

6 participants