Minikube Kubernetes kubectl MacOS错误

Minikube Kubernetes kubectl MacOS错误,kubernetes,kubectl,minikube,Kubernetes,Kubectl,Minikube,我只是按照说明使用brew在Mac上安装Minikube: https://github.com/kubernetes/minikube brew cask install minikube 然后我只是按照说明进行测试: minikube start 给了我以下信息: MacBook-Pro:~ joe$ minikube start Starting local Kubernetes v1.6.4 cluster... Starting VM... Moving files into c

我只是按照说明使用brew在Mac上安装Minikube:

https://github.com/kubernetes/minikube

brew cask install minikube
然后我只是按照说明进行测试:

minikube start
给了我以下信息:

MacBook-Pro:~ joe$ minikube start
Starting local Kubernetes v1.6.4 cluster...
Starting VM...
Moving files into cluster...
Setting up certs...
Starting cluster components...
Connecting to cluster...
Setting up kubeconfig...
Kubectl is now configured to use the cluster
然后,我试着要求kubectl版本:

MacBook-Pro:~ joe$ kubectl version
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.5", GitCommit:"5a0a696437ad35c133c0c8493f7e9d22b0f9b81b", GitTreeState:"clean", BuildDate:"2016-10-29T01:38:40Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"6", GitVersion:"v1.6.4", GitCommit:"d6f433224538d4f9ca2f7ae19b252e6fcb66a3ae", GitTreeState:"dirty", BuildDate:"2017-06-22T04:31:09Z", GoVersion:"go1.7.5", Compiler:"gc", Platform:"linux/amd64"}
然后我尝试了下面常见的hello world示例,这导致了错误(如下所示):

我找不到任何合适的答案。我想我的kubectl客户端应该更新。但我如何在我的Mac电脑上做到这一点?我猜它都是用brew安装的。你知道我怎样才能把它修好吗

编辑:尝试了Sebastien Goasguen的帖子

她的是我得到的:

MacBook-Pro:~ joe$ brew upgrade kubectl
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (caskroom/cask, homebrew/core).
==> Updated Formulae
bacula-fd           etcd                fio                 gx-go               kibana              metricbeat          packetbeat          subversion          webpack
certbot             exa                 gnumeric            heroku              libuv               mikutter            paket               tippecanoe          you-get
dos2unix            exploitdb           goffice             hugo                llnode              neovim              pyenv               vagrant-completion
elasticsearch       filebeat            gx                  irssi               logstash            numpy               remarshal           vim

Error: kubectl 1.7.0 already installed
MacBook-Pro:~ joe$ kubectl config use-context minikube
switched to context "minikube".
MacBook-Pro:~ joe$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
Unable to connect to the server: dial tcp 192.168.99.101:8443: i/o timeout
MacBook-Pro:~ joe$ minikube delete
Deleting local Kubernetes cluster...
Machine deleted.
MacBook-Pro:~ joe$

因此,首先更新
kubectl
。如果使用brew安装:


brew升级kubectl

否则,请检查此处的
kubectl
安装文档:

然后确保您的目标是minikube:


kubectl配置使用上下文minikube

如果仍然失败,请停止并删除minikube,然后从GitHub发布页面下载该版本重新安装:


看看我上面的帖子!我试过你说的,但还是没能成功!看起来在您的第二次尝试中,k8s端点不可用。minikube可能停顿了一下。在您的
minikube删除后
我会再次尝试
minikube启动
,然后再次检查版本
kubectl版本
MacBook-Pro:~ joe$ brew upgrade kubectl
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 2 taps (caskroom/cask, homebrew/core).
==> Updated Formulae
bacula-fd           etcd                fio                 gx-go               kibana              metricbeat          packetbeat          subversion          webpack
certbot             exa                 gnumeric            heroku              libuv               mikutter            paket               tippecanoe          you-get
dos2unix            exploitdb           goffice             hugo                llnode              neovim              pyenv               vagrant-completion
elasticsearch       filebeat            gx                  irssi               logstash            numpy               remarshal           vim

Error: kubectl 1.7.0 already installed
MacBook-Pro:~ joe$ kubectl config use-context minikube
switched to context "minikube".
MacBook-Pro:~ joe$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080
Unable to connect to the server: dial tcp 192.168.99.101:8443: i/o timeout
MacBook-Pro:~ joe$ minikube delete
Deleting local Kubernetes cluster...
Machine deleted.
MacBook-Pro:~ joe$