MuhammedKalkan / OpenLens

OpenLens Binary Build Repository
4.07k stars 272 forks source link

Terminal not switching with clusters #200

Open Filipcsupka opened 6 months ago

Filipcsupka commented 6 months ago

Hi, so the issue i have with OpenLens...

I have multiple clusters conected, some of them from kubeconfig synced from my WSL2 (Ubuntu) and some of them directly proxied since they need some auth stuff to let me in. Also terminal is connected to use wsl.exe to give me all the terminal tools and extensions i used previousli.

Now the ISSUE:

When i switch cluster from DEV to TEST, terminal stays on DEV and since we use same pod naming for like psql DB, mongo, and some core services... when i then go into SHELL it uses the kubectl exec... but from wrong cluster (DEV) even i switched to TEST and see resources from TEST and clicking on pod on TEST. But since the name is same and OpenLens is giving me shell access with command which is automatically placed in the terminal i am getting rekt.

As you can imagine this is causing lot of problems, i already updated psql DB in a wrong cluster because of that...

Any solutions, advice ?

busches commented 6 months ago

You can default a namespace per K8S config, not per namespace. You can duplicate the K8S config and setup each namespace in your .kubeconfig to be separate and then default the namespace in the terminal for each, that's what I do.