lensapp / lens

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

k0s not found kubectl #3064

Open borgez opened 3 years ago

borgez commented 3 years ago

image

alexdcox commented 3 years ago

To add some context to this issue, I'm also experiencing this on macOS 11.4 (20F71) using Lens version 4.2.5.

Lens seems to work fine for me until I try to update a service. In this case I switched a service type from LoadBalancer to NodePort and was presented with the above error. I can update the service no problem using the in-browser kubernetes dashboard editor. I noticed that there's an empty directory in App Support:

find ~/Library/Application\ Support/Lens/binaries

~/Library/Application Support/Lens/binaries
~/Library/Application Support/Lens/binaries/kubectl
~/Library/Application Support/Lens/binaries/kubectl/1.21.1-3+ba118484dd39df          <-- where is the binary??
~/Library/Application Support/Lens/binaries/kubectl/1.18.15
~/Library/Application Support/Lens/binaries/kubectl/1.18.15/kubectl

I'm not running 1.18.15, perhaps this is a default or something picked up by my local docker desktop install. 1.21... is correct, however there isn't a kubectl binary in there. I tried this as a workaround:

cp $(readlink $(which kubectl)) ~/Library/Application\ Support/Lens/binaries/kubectl/1.21.1-3+ba118484dd39df/

Which moved my working kubectl into the expected location. Attempting the update again reproduced the error, and the binary I copied had been removed.

I'm connecting to an Ubuntu VM running microk8s within VirtualBox, running on a Windows 10 machine on my LAN. The Ubuntu VM is using a bridged network adapter and has its own IP.

Lens: 4.2.5
Electron: 9.4.4
Chrome: 83.0.4103.122
Node: 12.14.1

snap list

microk8s  v1.21.1     2262   1.21/stable    canonical✓  classic
snapd     2.51        12159  latest/stable  canonical✓  snapd
...

Hope that helps diagnose this. Really nice tool, appreciate the work that's gone into it. Let me know if I can provide any more info.