openshift / origin

Conformance test suite for OpenShift
http://www.openshift.org
Apache License 2.0
8.49k stars 4.7k forks source link

Is it possible for a route to expose multiple ports? #16529

Closed theangrydev closed 5 years ago

theangrydev commented 7 years ago

I have a service with many ports that I would like to expose. Kubernetes services support multiple ports. OpenShift routes seem to not support multiple ports.

Version

Any.

Steps To Reproduce

Expose a route to a service with multiple ports.

Current Result

Only one port is exposed.

Expected Result

All the ports are exposed.

gamkiller77 commented 7 years ago

You can but you have to setup Ingress controller. Look at the doc for this. It not a fun task.

theangrydev commented 7 years ago

@gamkiller77 Can you link me to the relevant section in the documentation, please? Do you know if anyone has written a blog post about this or anything like that?

theangrydev commented 7 years ago

@gamkiller77 Also, is this on the OpenShift roadmap as something to support without manually setting up Ingress? I may be interested in contributing this if I am able to.

gamkiller77 commented 7 years ago

This is what I used to track down the true problem.

https://docs.openshift.org/3.6/admin_guide/sdn_troubleshooting.html https://docs.openshift.org/3.6/admin_guide/sdn_troubleshooting.html

Andy

On Sep 25, 2017, at 11:43 AM, Liam Williams notifications@github.com wrote:

@gamkiller77 https://github.com/gamkiller77 Can you link me to the relevant section in the documentation, please? Do you know if anyone has written a blog post about this or anything like that?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openshift/origin/issues/16529#issuecomment-331975124, or mute the thread https://github.com/notifications/unsubscribe-auth/AD0iSo03RPjXu-_7LNn4sXYCvE3MJkGXks5sl_RlgaJpZM4PiPyF.

ccll commented 7 years ago

I'm facing the same issue here. I deployed a gogs (git server) in my Openshift cluster, the pod exposes 2 ports where 3000 for HTTP and 22 for SSH access, but the route object can only expose 1 of the 2 ports to external world.

gamkiller77 commented 7 years ago

Yah see this is the key problem with this setup. Great use case but there no simple solution.

Andy del Hierro From the power of an iPhone 7 Plus

On Nov 7, 2017, at 9:01 PM, Cai Lei notifications@github.com wrote:

I'm facing the same issue here. I deployed a gogs (git server) in my Openshift cluster, the pod exposes 2 ports where 3000 for HTTP and 22 for SSH access, but the route object can only expose 1 of the 2 ports to external world.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

gamkiller77 commented 7 years ago

Ok I just talked to a team mate. You can do this with ingress. Setup the service to expose what you need 80/443 and 22. You then switch this service to ingress load balancer so you get an IP with multiple Ports on one IP.

Karthikeyashastry commented 6 years ago

@gamkiller77 Could you help me out by indicating how ingress load balancer can be set up ?

gamkiller77 commented 6 years ago

@Karthikeyashastry not sure how to private message in GIT but hit me up and i try and help.

ravishankarhassain commented 6 years ago

@gamkiller77 : Can you point me to some link or document where I can configure ingress in openshift to expose routes backed by service running in different ports

Karthikeyashastry commented 6 years ago

@ravishankarhassain : Instead of ingress, simplest thing to do would be to delete your existing service, and create individual service for each of the exposed port, and create routes for these new services

ravishankarhassain commented 6 years ago

yeah sounds good I will try it

tocosonic commented 6 years ago

by doing so, it is still not possible to use the same host name for different ports. When using one service with multiple ports you can also create routes for each of those ports, but you have to use different host names :-(

openshift-bot commented 6 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

ftcvlad commented 6 years ago

@tocosonic exactly!

My app does http and websocket requests. So, I need to map to two ports. I can do it with 2 routes, but in this case since host names are different, I cannot use same session cookie

openshift-bot commented 6 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot commented 6 years ago

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-ci-robot commented 6 years ago

@orange00: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-425812907): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
orange00 commented 6 years ago

Also, it is possible to create individual routers in 'default' namespace for each exposed port. That should work too.

Eg., to have a router for port 8080 (instead of 80), edit the router YAML and replace all occurences of '80' with '8080'

To have multiple routers for different ports, copy router YAML, change every occurence of port and router name, and import the YAML as a new router.

@tocosonic This way you can use the same host for different routes (because, different ports will be served by different routers)

If you have multiple routers (each for different ports), each of your routes will be accessible on every port.

If you want to limit which routes will be accessible on which ports, you can use router sharding. Router sharding means that routers will use selectors to serve only some routes.

That way, for eg., router for port 8080 can serve only backend routes and router for port 80 can serve only frontend routes.

ROUTER SHARDING --add env. variable to router: ROUTE_LABELS="router=8080" => serves as a route selector --ie., router will only serve routes that have a label: router=8080 --add label to route: router=8080

orange00 commented 6 years ago

/remove-lifecycle rotten

orange00 commented 6 years ago

/reopen

openshift-ci-robot commented 6 years ago

@orange00: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-427033839): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
theangrydev commented 5 years ago

/reopen

openshift-ci-robot commented 5 years ago

@theangrydev: Reopened this issue.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-449159261): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-bot commented 5 years ago

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

openshift-bot commented 5 years ago

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity. Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten /remove-lifecycle stale

openshift-bot commented 5 years ago

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-ci-robot commented 5 years ago

@openshift-bot: Closing this issue.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-493855006): >Rotten issues close after 30d of inactivity. > >Reopen the issue by commenting `/reopen`. >Mark the issue as fresh by commenting `/remove-lifecycle rotten`. >Exclude this issue from closing again by commenting `/lifecycle frozen`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
theangrydev commented 5 years ago

/reopen this is still not possible with routes but there are workarounds as discussed above

theangrydev commented 5 years ago

/reopen

openshift-ci-robot commented 5 years ago

@theangrydev: Reopened this issue.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-493902098): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-bot commented 5 years ago

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen. Mark the issue as fresh by commenting /remove-lifecycle rotten. Exclude this issue from closing again by commenting /lifecycle frozen.

/close

openshift-ci-robot commented 5 years ago

@openshift-bot: Closing this issue.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-503573025): >Rotten issues close after 30d of inactivity. > >Reopen the issue by commenting `/reopen`. >Mark the issue as fresh by commenting `/remove-lifecycle rotten`. >Exclude this issue from closing again by commenting `/lifecycle frozen`. > >/close Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
openshift-ci-robot commented 4 years ago

@AstroViking: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-707029252): >/reopen >/remove-lifecycle rotten Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
rcfja commented 2 years ago

Is this still an issue or is there a way to open multiple ports on the same route, and can someone link to documentation for that?

rishabh625 commented 2 years ago

/reopen

openshift-ci[bot] commented 2 years ago

@rishabh625: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-1148970778): > >/reopen > > > Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
guai commented 7 months ago

bump

openshift-ci[bot] commented 7 months ago

@tocosonic: You can't reopen an issue/PR unless you authored it or you are a collaborator.

In response to [this](https://github.com/openshift/origin/issues/16529#issuecomment-2049958003): >/reopen Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.