lens icon indicating copy to clipboard operation
lens copied to clipboard

Port-forward - Custom source port and local address (k9s-like) 💻

Open Grraahaam opened this issue 3 years ago • 1 comments

Hello you all! 👋🏽

I'd like to thanks the contributors for this awesome tool, great job! 👍🏽

There's an enhancement I'd like to suggest, and see if others might be interested too!

What would you like to be added :

  • A clear UI modal for port-forward's creation/edition, with both source and local ports/addresses when creating a port-forward (either from a pod or from a service).

Why is this needed :

  • Port-forward specific source ports (e.g. debug ports, internal services) that may not be exposed explicitly, but there are still reachable through a native port-forward. Today, we're only allowed to edit the local port, not the remote (source) one.

Details :

  • Kubernetes distribution: Cloud provider (k8s v1.23.1)
  • Desktop OS: Linux

Description 📣

I'll try to describe as much as possible what I have in mind.

Being able to run the equivalent of the below commands in Lens (examples from kubectl port-forward --help) :

# Listen on port 8888 locally, forwarding to 5000 in the pod
kubectl port-forward pod/mypod 8888:5000

# Listen on port 8888 on all addresses, forwarding to 5000 in the pod
kubectl port-forward --address 0.0.0.0 pod/mypod 8888:5000

# Listen on port 8888 on localhost and selected IP, forwarding to 5000 in the pod
kubectl port-forward --address localhost,10.19.21.23 pod/mypod 8888:5000

A mix between the current Lens and k9s (also a great tool) :

Lens k9s
lens k9s

Would give something like the following :

modal-suggest


I've searched through https://github.com/lensapp/lens/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement+port+forward and haven't find anything like this, but here's some potentionally related issues :

  • https://github.com/lensapp/lens/pull/3922
  • https://github.com/lensapp/lens/issues/85
  • https://github.com/lensapp/lens/issues/2340#issuecomment-918676574 (same use case)
  • https://github.com/lensapp/lens/issues/542
  • https://github.com/lensapp/lens/issues/5952 (probably related)

I'm open to discussions and thoughs about this request. And I'd really love to see this feature in Lens shortly (and I thanks the contributors that may spend time on it), to allow me to switch entirely to it (and avoid creating PF through kubectl or k9s, even if have no problem with the latter, it's just more convenient to have everything in the same application)

Cheers! :v:

Grraahaam avatar Dec 20 '22 00:12 Grraahaam

hi there! is this something will never happened or am I wrong?

casualuser avatar Apr 04 '24 23:04 casualuser