Lens Kubernetes Nod...
 
Notifications
Clear all

Lens Kubernetes Node Shell Microk8s the command could not be located

1 Posts
1 Users
0 Reactions
40 Views
Brandon Lee
Posts: 398
Admin
Topic starter
(@brandon-lee)
Member
Joined: 14 years ago

If you use the Lens Desktop Kubernetes IDE to work with your Kubernetes clusters (it is one of the best ones out there), you may have run into a problem when launching a node shell that gives the error message:

Command 'microk8s' is available in '/snap/bin/microk8s'
The command could not be located because '/snap/bin' is not included in the PATH environment variable.
microk8s: command not found

This is what it looks like in the node shell:

the command could not be located error with lens and microk8s

There is a little workaround fix that will make it where you won't run into this issue. It involves editing yourย .bashrc file.ย 

nano ~/.bashrc

Then add the following at the bottom of the .bashrc file:

export PATH=$PATH:/snap/bin
adding the path to the .bashrc file

Then to make the changes active, run the following command:

source ~/.bashrc

ย 

Then you can check to see if you can run microk8s commands:

running microk8s after the fix is in place with lens node shell

ย 

Hopefully, this little fix will help anyone else that may have run into this issue working with a Microk8s cluster with Lens Desktop Kubernetes IDE.

Topic Tags