lensapp / lens

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

Automatically open SSH tunnel with port forwarding #647

Open joushx opened 4 years ago

joushx commented 4 years ago

What would you like to be added:

Port-forwarding of K8s API via SSH. Run ssh user@example.org -L 6443:kubernetes-api-example:6443 when selecting a cluster and close the connection when selecting different cluster

Why is this needed:

When working with multiple clusters where the Kubernetes API is not accessable from public, one has to manually open and close SSH connections when switching clusters

Environment you are Lens application on:

yuyuvn commented 3 years ago

@joushx You can achieve that by use different port for tunnel. For example:

ssh user@example.org -L 10443:kubernetes-api-example-1:6443
ssh user@example.org -L 11443:kubernetes-api-example-2:6443

and change server api port to 10443 and 11443 for each server in kubeconfig file.


In my case, I run in Windows, so create ssh tunnel is not as simple as linux. LENS with connect via SSH setting would be cool.

jkroepke commented 3 years ago

I agree, a lot of K8S APIs are behind a bastion host. This feature inside lens would be awesome.

Additionaly, on windows there isn't a good ssh tunnel manager. The handling is a pain.

skandragon commented 2 years ago

Seconded. We have recently moved to a more secure cluster config, where one must log into a bastion host to issue kubectl commands, and this means no more Lens for us. We see many of our customers who also cannot use Lens for similar reasons.

Being able to set up an SSH session to the bastion would solve this problem, so long as the Kubernetes credentials used only remains on the bastion.

stlr00 commented 1 year ago

+1 this will be greate

stlr00 commented 1 year ago

nobody care(

MarcusAhlfors commented 1 year ago

Just about every sql ide supports this, maybe copying UX/workflow from there would make it easier to implemetn. It would make lens so much more useful

fatsolko commented 5 months ago

I need it too

iRajesha commented 2 months ago

Very much needed functionality !!!