我安装了“Windows 10 上的 Ubuntu 终端”并尝试执行 kubectl 命令。
问题是我必须在命令中添加.exe 文件扩展名才能操作它。
如果我不这样做,我会得到:
kubectl: command not found
例如:
tal@shell130:~$ kubectl.exe version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.0", GitCommit:"cb303e613a121a29364f75cc67d3d580833a7479", GitTreeState:"clean", BuildDate:"2021-04-08T16:31:21Z", GoVersion:"go1.16.1", Compiler:"gc", Platform:"wind
ows/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.7", GitCommit:"65ecaf0671341311ce6aea0edab46ee69f65d59e", GitTreeState:"clean", BuildDate:"2019-01-24T19:22:45Z", GoVersion:"go1.10.7", Compiler:"gc", Platform:"linu
x/amd64"}
WARNING: version difference between client (1.21) and server (1.11) exceeds the supported minor version skew of +/-1
tal@shell130:~$ kubectl version
kubectl: command not found
另一方面,在 powershell 上,即使没有文件扩展名,它对我来说也可以工作。
我该如何解决这种情况?
谢谢