lensapp / lens

Lens - The way the world runs Kubernetes
https://k8slens.dev/
MIT License
22.53k stars 1.47k forks source link

Port Forwarding auto activating / false active status #5402

Open dark0ni opened 2 years ago

dark0ni commented 2 years ago

Why is this needed:

I have a suggestion for the Lens App. When I start the program or use it after a standby, I have to re-enable all port forwardings for various clusters. Over 30 namespaces for the database connection

It is also incorrectly displayed that these are still active. I have to click on "Change port or protocol" button and then click on modify without changing the port to re-establish the connection.

What would you like to be added:

My suggestion would be to check if the port forwarding connections are still active and restart them automatically. Alternatively, offer the possibility to activate all portforwardings with one click.

Environment you are Lens application on: Lens: 5.4.6-latest Desktop OS: Windows 11

jim-docker commented 2 years ago

Thanks for reporting. This is something we are aware of and would like to improve. Lens starts a kubectl port-forward process for each port-forward. The issue arises because when a port-forward is disrupted the kubectl process does not always stop. We may need to parse the process's stdout and/or stderr to determine the port-forward status. This is fragile and may not work with the changing versions of kubectl. Or there may be a more robust way, which will require further investigation. This work is not currently on our roadmap.

Regarding restarting all port forwards at once, you can disconnect and then reconnect to the cluster. This will restart them all for that cluster.

dark0ni commented 2 years ago

thank you for your tip 👍🏻

metalrex100 commented 2 years ago

False active status is also described in this issue: https://github.com/lensapp/lens/issues/5190