作业系统:OSX(mac)
docker :18.06.0-ce(边缘)
Kubernetes:1.10.3
我第一次使用Kubernetes。
我尝试使用Google,但找不到适用于Mac的Kubernetes手册。
运行kubectl version
输出The connection to the
server localhost:8080 was refused - did you specify the right host or port?
最佳答案
当您运行kubectl
时,会在主目录中读取.kube/config
文件,从而使用--context=<cluster-name>
告诉您要连接到哪个集群
错误输出告诉您,它找不到在其上运行这些命令的侦听kubernetes
API端点。它正在localhost:8080
寻找集群
该终结点将根据安装Kubernetes的方式和位置而有所不同。您如何运行Kubernetes?
您是否在使用此处提到的 bundle 的 Docker / Kubernetes for Mac ? -Docker for Mac Kubernetes还是您正在使用 MiniKube之类的工具? -MiniKube
关于macos - Mac中的Kubernetes连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51612629/