-
Notifications
You must be signed in to change notification settings - Fork 243
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
Allow users define custom port-mappings for port forwarding #6479
Comments
Grooming (2023-03-23)
|
Should we allow
|
This issue will be fixed in 3 parts to avoid larger PR size:
|
What port range should we accept? Currently it accepts any value between 1 to 65535. Should we increase the lower limit to 1024? |
I think we should not prevent that. |
/kind user-story
User Story
As an odo user, I want to be able to define a mapping for port-forwarding So that I can have predictable port numbers; this is useful when developing multi-component applications.
example:
cd frontend
odo dev
cd ../backend
odo dev
configure the
frontend
to use port 20002 (odo dev
for backed was started second)I stop everything, next day I want to continue working but this time I start
odo dev
session forbackend
beforefrontend
. Now I have to keep in mind to reconfigure the frontend to use a different port.A slightly better experience would be to have
cd frontend
odo dev
cd ../backend
odo dev --port-forward 8888:8000
Now no matter what order I run commands, I will get backed on localhost:8888.
An even better experience would be for odo to remember custom port mappings so next time I can just do
odo dev
. This is something that we can look into as second stage.Acceptance Criteria
odo dev
command using--port-forward
flag. Flag accepts argument in<localPort>:<containerPort>
port-forward
can be defined as multiple times (for multiple ports)--port-forward <localPort>:<containerName>:<containerPort>
--address <ipaddress>
flag should allow specifying on which local address the port will be listeningHandle(not handled in the Devfile library: SupportdedicatedPod
(is it handled currently?)dedicatedPod
field oncontainer
components #6786)--random-port
and--port-forward
together.allowed formats for
--port-forward
8080:80
- local port 8080 listening only onlocalhost
, container port 808080:mycontainer:80
- local port 8080 listening only onlocalhost
, container port 80 on container called mycontainer/kind user-story
The text was updated successfully, but these errors were encountered: