通过安装kubectl
后,Windows10上出现以下错误
choco install kubernetes-cli
:
PowerShell
PS C:\Users\userA> kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
Cmd
C:\Users\userA>kubectl version
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.11", GitCommit:"637c7e288581ee40ab4ca210618a89a555b6e7e9", GitTreeState:"clean", BuildDate:"2018-11-26T14:38:32Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"windows/amd64"}
Unable to connect to the server: dial tcp [::1]:8080: connectex: No connection could be made because the target machine actively refused it.
我创建了.kube
文件夹(C:\Users\userA\.kube
),并且其中有一个空的config
文件
我设置了Windows环境变量:
Variable_name
:KUBECONFIG
value
:C:\Users\userA\.kube\config
编辑:我使用running
迷你库对其进行了测试:
答案 0 :(得分:2)
您需要先使用以下命令启动服务器
:minikube start
编辑:当op尝试使用hyper-v时,以下命令告诉minikube使用hyper-v
minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"
要进行此工作,还必须在hyper-v中设置一个名为“主虚拟交换机”的虚拟交换机。
答案 1 :(得分:0)
我自己知道了-在Windows 10
上
如果您使用的是Hyper-V
,则应打开Docker desktop
,而对于minikube
,应将其关闭。
关闭Hyper-V
并重新启动PC后,minikube start
可以正常工作。