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
[proposal] kubectl port-forward listen on custom address #43962
Comments
@kubernetes/sig-cli-misc |
The CLI part of the proposal looks fine to me, being concise with |
/sig cli |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
Hi, |
#46517 has implementation (needs a rebase after all that time) but it was put on hold due to feedback from @smarterclayton . No idea if the blocking work was completed so awaiting for confirmation before I invest time in the rebase/refactor. |
I have no idea how I missed that PR, I'll follow that. Thanks for the work too, it would really be a nice feature to have! |
@goblain The work has been completed: And implemented in the java client at least: Its frustrating that this very reasonable change was blocked because "other stuff is happening" - other stuff is always happening, and not being able to control the binding address is ridiculous. |
Issues go stale after 90d of inactivity. If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or fejta. |
/remove-lifecycle stale |
+1 |
1 similar comment
+1 |
well, I've stopped rebasing the #46517 pull request cause it seems there is no will to merge it in foreseeable future. |
@goblain are you planning to keep pushing for this to get merged ? I think this is still needed. Just ran into that issue. |
the decision to go with this is way above me, so I am unable to influence this further. Seems like there simply is no will to merge this into upstream in near future |
+1 here too Has anyone worked out a reliable workaround in the meantime? |
+1. Till this is implemented or merged, ssh tunneling can be used on a (yet another) separate terminal (assuming port 8000 is not used on any interface on the host and assuming and then go to your web-browser and type: http://host:8000 |
+1 need this feature as well. |
+1 need the feature ASAP Was able to create a workaround as mentioned by @Baykonur . Follow the below to work with the actual port itself instead of another temporary one.
|
I ran into this issue myself today. Made me very sad sniffle. Especially considering
To workaround this feature not yet being implemented/merged... you can port-forward your already port-forwarded port using
^ where e.g.
|
I ran into this, too. kube-proxy does the right thing, why not kube-port-forward? |
Another slight variation on the work-arounds described above using ssh tunnels. In my case, I'm running minikube with an http web service deployed on NodePort 30003.
|
Implementing this proposal that will solve issues raised in #36152 and #29678. In short: allow binding on addresses other then currently supported
127.0.0.1
and::1
The idea is to implement a new method
NewOnAddress
in pkg/client/unversioned/portforward/portforward.go that will add an address parameter, and refactorNew
as a wrapper on theNewOnAddress
pointing to "localhost" address.The
NewOnAddress
would work asNew
did previously (that is callinglistenOnPortAndAddress
) with a difference of setting the new PortForwarder private variableaddress
that can take string representations of IPv4, IPv6, "localhost" or nil. ThenlistenOnPort
will be changed in a way that if IPv4 or IPv6 is provided inPortForwarder.address
, the address given wil be the only one used (if it is a valid one). If value "localhost" or nil is passed, it will behave exactly as it does now - listening on127.0.0.1
and[::1]
.pkg/kubectl/cmd/portforward.go will be modified to call
NewOnAddress
method instead ofNew
with new option address provided by-a
or--address
flag onkubectl port-forward
command and passed via a new string variableAddress
in updated PortForwardOptions type.The text was updated successfully, but these errors were encountered: