Learning Path: Mendix for Private Cloud - error with kubectl

1
I'm trying to follow the Advanced Learning Path ‘Mendix for the Private Cloud’. I've been following the instructions to set up Microk8s (which is no picknick) but when I try to run the installation in Powershell I get the following error message:  Error: failed to access cluster: unable to locate 'kubectl’ binary: exec:  “kubectl”: executable file not found in %PATH% I've tinkered around with it quite a bit and checked and rechecked all my settings. The kubetcl.exe file is in the C:\Users\UserName\Documents directory. I filled in ‘C:\Users\UserName\Documents\kubectl’ in my system environment variables. Any ideas are welcome.
asked
3 answers
1

I know this is an old thread but I believe I have the answer here: your env variable is supposed to be the directory NOT including the file name itself.

 

C:\Users\UserName\Documents\kubectl = incorrect

C:\Users\UserName\Documents = correct

answered
0

Just a guess: got the right rights? Will it help to run powershell ‘as administrator’?

answered
0

Easiest is to just copy the kubectl executable to a directory currently known in PATH. In my case:

 

C:\Users\xcheng>echo %PATH%
C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Users\xcheng\AppData\Local\Microsoft\WindowsApps;

 

so copy kubectl.exe to C:\Windows\

 

Or you can add the directory of which your kubectl is located to PATH: https://www.computerhope.com/issues/ch000549.htm 

answered