Home > Software engineering >  kubectl: not found in WSL terminal
kubectl: not found in WSL terminal

Time:09-17

I installed WSL2 on Windows10 followed these instructions: https://docs.microsoft.com/en-us/windows/wsl/install-win10, manual install.

All commands worked for me however at the end when I open wsl terminal and type kubectl I have response -sh: kubectl: not found.

I installed Ubuntu 20.04 LTS and when I open the Ubuntu terminal then kubectl works there.

Powershell says it's installed correctly:

PS C:\Users\michu> wsl --list --verbose
  NAME                   STATE           VERSION
 *docker-desktop         Running         2
  docker-desktop-data    Running         2
  Ubuntu-20.04           Running         2

How can I make docker/kubectl works in the WSL terminal as well?
Shouldn't it work right after all the instruction steps?

CodePudding user response:

The answer was in one of the comments, clarifying it so it will be useful to others as well

# run this command in order to enable kubectl in your wsl terminal
wsl --setdefault Ubuntu-20.04
  • Related