guiqui / k8Studio

K8Studio: A Kubernetes IDE
https://k8studio.io
Other
807 stars 25 forks source link

Unable to connect to cluster #76

Closed elibrody closed 6 months ago

elibrody commented 7 months ago

kubectl in powershell works but for some reason im getting this I did define the location of the kubeconfig file in settings

image

mo-othman commented 7 months ago

Hi @elibrody

I have a question to be able to reproduce the issue Do you remember how have you installed kubectl?

meanwhile you can try to open the application by powershell it should work

elibrody commented 7 months ago

I downloaded kubectl and added it to my windows path

I just tried removing the path and installing with winget install -e --id Kubernetes.kubectl as seen here and have the same results even when running K8sStudio via powershell kubectl in powershell works perfectly tho

See logs displayed in powershell

AppData\Local\Programs\K8Studio\resources\app.asar\dist\main (node:37924) DeprecationWarning: findLogPath() is deprecated and will be removed in v5. (Use `K8Studio --trace-deprecation ...` to show where the warning was created) CHECKING FOR UPDATES..... 09:53:37.879 > Checking for update 09:53:37.881 > checking-for-update 09:53:38.710 > Update for version 0.2.3-alpha is not available (latest version: 0.2.3-alpha, downgrade is disallowed). 09:53:38.712 > update-not-available 09:53:38.714 > checkForUpdatesAndNotify called, downloadPromise is null (node:37924) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. Error: Command failed: kubectl config use-context default 'kubectl' is not recognized as an internal or external command, operable program or batch file.

mo-othman commented 7 months ago

Hi @elibrody

Have you reopened the app after installing with winget ?

I have done those steps to try to reproduce the issue

The app is working for me Is there anything I'm missing?

and btw I was testing using v1.0.0-beta

elibrody commented 7 months ago

Hi @elibrody

Have you reopened the app after installing with winget ?

I have done those steps to try to reproduce the issue

  • Deleted my Kubectl and have checked through cmdline it's deleted
  • Installed kubectl by winget
  • opened the app

The app is working for me Is there anything I'm missing?

and btw I was testing using v1.0.0-beta

@mo-othman That is what I tested one thought where is your K8sStudio installed? mine is at C:\Users\%UserName%\AppData\Local\Programs\K8Studio

I tested in both 1.0.0-Beta and in the latest release from yesterday I will try to disable my AV to see if its related to that I dont think so as I dont see anything in the logs

mo-othman commented 6 months ago

Yes installed in the same path

Any results after disabling the AV?

elibrody commented 6 months ago

I tried this today so far no luck

mo-othman commented 6 months ago

Hi @elibrody

Is kubectl working when using cmd (command prompt)? also when you do "which kubectl" in cmd what's the path you are getting?

elibrody commented 6 months ago

Kubectl is working correctly the kubeconfig is working correctly as long as im in powershell cmd does not seem to work

when running the powershell alternative for the which kubectl command is

Get-Command kubectl or shorthand is gcm kubectl returns C:\Users\username\AppData\Local\Microsoft\WinGet\Links\kubectl.exe

mo-othman commented 6 months ago

when running $env:ComSpec in powershell what do you get as a default shell?

elibrody commented 6 months ago

That's a great find it was set to cmd switched it to powershell all works now thanks

mo-othman commented 6 months ago

Yes exactly!

We will review those part and hopefully the application can be better at handling this

elibrody commented 6 months ago

Thanks and even if you can't fix it at least adding a log saying to check default shell or a note in the docs is a great start (will try to do a pr at some point