kubectl:在 WSL 终端中找不到
kubectl: not found in WSL terminal
我按照以下说明在 Windows10 上安装了 WSL2:https://docs.microsoft.com/en-us/windows/wsl/install-win10,手动安装。
所有命令都对我有用,但是最后当我打开 wsl 终端并输入 kubectl
时,我得到了响应 -sh: kubectl: not found
。
我安装了 Ubuntu 20.04 LTS,当我打开 Ubuntu 终端时,kubectl 在那里工作。
Powershell 表示已正确安装:
PS C:\Users\michu> wsl --list --verbose
NAME STATE VERSION
*docker-desktop Running 2
docker-desktop-data Running 2
Ubuntu-20.04 Running 2
如何使 docker/kubectl 在 WSL 终端中也能正常工作?
在完成所有说明步骤后它不应该立即工作吗?
回答在其中一条评论中,对其进行了澄清,因此对其他人也有用
# run this command in order to enable kubectl in your wsl terminal
wsl --setdefault Ubuntu-20.04
我按照以下说明在 Windows10 上安装了 WSL2:https://docs.microsoft.com/en-us/windows/wsl/install-win10,手动安装。
所有命令都对我有用,但是最后当我打开 wsl 终端并输入 kubectl
时,我得到了响应 -sh: kubectl: not found
。
我安装了 Ubuntu 20.04 LTS,当我打开 Ubuntu 终端时,kubectl 在那里工作。
Powershell 表示已正确安装:
PS C:\Users\michu> wsl --list --verbose
NAME STATE VERSION
*docker-desktop Running 2
docker-desktop-data Running 2
Ubuntu-20.04 Running 2
如何使 docker/kubectl 在 WSL 终端中也能正常工作?
在完成所有说明步骤后它不应该立即工作吗?
回答在其中一条评论中,对其进行了澄清,因此对其他人也有用
# run this command in order to enable kubectl in your wsl terminal
wsl --setdefault Ubuntu-20.04