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

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

Closed
theangrydev opened this issue Sep 25, 2017 · 39 comments
Closed

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

theangrydev opened this issue Sep 25, 2017 · 39 comments

Comments

@theangrydev
Copy link

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

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

@theangrydev
Copy link
Author

@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
Copy link
Author

@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
Copy link

gamkiller77 commented Sep 25, 2017 via email

@ccll
Copy link

ccll commented Nov 8, 2017

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

gamkiller77 commented Nov 8, 2017 via email

@gamkiller77
Copy link

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

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

@gamkiller77
Copy link

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

@ravishankarhassain
Copy link

@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
Copy link

@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
Copy link

yeah sounds good I will try it

@tocosonic
Copy link

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
Copy link
Contributor

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-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Apr 18, 2018
@ftcvlad
Copy link

ftcvlad commented May 10, 2018

@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
Copy link
Contributor

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-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Jun 9, 2018
@openshift-bot
Copy link
Contributor

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

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

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@orange00
Copy link

orange00 commented Oct 3, 2018

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

orange00 commented Oct 3, 2018

/remove-lifecycle rotten

@openshift-ci-robot openshift-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 3, 2018
@orange00
Copy link

orange00 commented Oct 4, 2018

/reopen

@openshift-ci-robot
Copy link

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

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theangrydev
Copy link
Author

/reopen

@openshift-ci-robot
Copy link

@theangrydev: Reopened this issue.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-bot
Copy link
Contributor

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-ci-robot openshift-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Mar 21, 2019
@openshift-bot
Copy link
Contributor

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-ci-robot openshift-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Apr 20, 2019
@openshift-bot
Copy link
Contributor

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

@openshift-bot: Closing this issue.

In response to this:

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@theangrydev
Copy link
Author

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

@theangrydev
Copy link
Author

/reopen

@openshift-ci-robot
Copy link

@theangrydev: Reopened this issue.

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-bot
Copy link
Contributor

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

@openshift-bot: Closing this issue.

In response to this:

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. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot
Copy link

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

In response to this:

/reopen
/remove-lifecycle rotten

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Oct 12, 2020
@rcfja
Copy link

rcfja commented Mar 16, 2022

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

/reopen

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jun 7, 2022

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

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@guai
Copy link

guai commented Apr 11, 2024

bump

Copy link
Contributor

openshift-ci bot commented Apr 11, 2024

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

In response to this:

/reopen

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests