kubernetes-client icon indicating copy to clipboard operation
kubernetes-client copied to clipboard

local address argument to override localhost in portForward API

Open MatanLevy opened this issue 3 years ago • 3 comments

Hi, I see currently that the API for port forwarding does not support passing as an argument local address (as possible in kubectl command: https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#port-forward), but only container port and local port, so it will always default to localhost address.

Is there a way to achieve override to localhost with my address with current API ?

and if not, is it possible to add support for it?

Thanks!

MatanLevy avatar Dec 30 '21 09:12 MatanLevy

https://github.com/fabric8io/kubernetes-client/issues/3234

manusa avatar Jan 10 '22 11:01 manusa

@MatanLevy : Hello, I remember while investigating #3234 I had added an additional method to PortForwardable interface. I've created a draft PR for this https://github.com/fabric8io/kubernetes-client/pull/3730

Would it be possible for you to review/try it out by building SNAPSHOT based on my branch and provide feedback on whether it's working for your use case?

rohanKanojia avatar Jan 10 '22 14:01 rohanKanojia

I think the local address can be provided like this:

https://github.com/fabric8io/kubernetes-client/blob/8ebcd808a4294894d09b3fe0499271a2d5c66bec/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/PortForwardExample.java#L56-L57

Shall we close this issue?

rohanKanojia avatar Jun 08 '22 08:06 rohanKanojia

This issue has been automatically marked as stale because it has not had any activity since 90 days. It will be closed if no further activity occurs within 7 days. Thank you for your contributions!

stale[bot] avatar Sep 06 '22 09:09 stale[bot]