cmd - Kubernetes 连接在端口 8080 上被拒绝 - Windows 10
问题描述
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
minikube 测试了它:
解决方案
您需要先启动服务器,使用:
minikube start
编辑:当 op 尝试使用 hyper-v 时,以下命令告诉 minikube 使用 hyper-v
minikube start --vm-driver hyperv --hyperv-virtual-switch "Primary Virtual Switch"
为了实现这个工作,还需要在 hyper-v 中设置一个名为“Primary Virtual Switch”的虚拟交换机。
推荐阅读
- flutter - 跳出无效图像链接的 For 循环 Flutter
- python - 有没有办法自动识别照片中折线图的位置并将其数字化?
- microservices - 我什么时候想创建多个 Verticle(假设我在无状态微服务中使用非阻塞数据库客户端)?
- scala - 将序列连接到地图时的奇怪行为(Scala 2.13)
- python - 在引用之前已分配变量,但仍收到 UnboundLocalError
- angular - Angular Firestore 有时会重复条目
- c# - 从 ConcurrentDictionary 中按键获取 KeyValuePair(在 O(1) 时间内)
- node.js - 为什么 coinbase api 在代码正常工作时返回错误?
- ruby-on-rails - 回滚 Ruby 版本会导致问题
- android - 从 MediaStore.Images.Media 获取图片方向