我是Kubernetes的新手。我正在尝试在本地Mac机器上启动kubernetes集群。我正在使用以下命令启动Kubernetes:
minikube start --vm-driver=hyperkit
我遇到以下错误:
/usr/local/bin/kubectl is version 1.14.7, and is incompatible with Kubernetes 1.17.0.
You will need to update /usr/local/bin/kubectl or use 'minikube kubectl' to connect with this cluster
现在在执行以下命令时:
minikube kubectl
它什么也没做,只是显示基本命令及其用法。
在尝试升级kubetctl时,它表明它已经是最新的。
我没有找到任何解决方案。有关如何解决此问题的想法吗?
答案 0 :(得分:6)
如果您已经升级并出现相同的错误,请尝试以下操作
brew link --overwrite kubernetes-cli
答案 1 :(得分:0)
升级minikube(和kubernetes-cli
)的最佳选择。 kubectl当前的最新版本是1.17.0
和minikube 1.6.1
。
brew upgrade minikube
brew upgrade kubernetes-cli
其他选项是在minikube中运行特定版本的kubernetes。
minikube start --vm-driver=virtualbox --kubernetes-version=1.14.7
我在对kubernetes使用kubectl 1.17时收到类似的错误消息
已安装--kubernetes-version=1.14.7
/usr/local/bin/kubectl is version 1.17.0, and is incompatible with Kubernetes 1.14.7. You will need to update /usr/local/bin/kubectl or use 'minikube kubectl' to connect with this cluster
答案 2 :(得分:0)
最适合您的解决方案是update kubectl manually。要执行此操作,您需要下载二进制文件:
https://storage.googleapis.com/kubernetes-release/release/v1.17.0/bin/darwin/amd64/kubectl
将kubectl的权限更改为可执行:
$ chmod +x ./kubectl
然后移至/ usr / local / bin /覆盖旧的。
$ sudo mv ./kubectl /usr/local/bin/kubectl
要检查效果,请运行:
$ kubectl version
答案 3 :(得分:0)
匹配客户端和服务器版本已修复的问题,
➜ ~ kubectl version
Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.5", GitCommit:"20c265fef0741dd71a66480e35bd69f18351daea", GitTreeState:"clean", BuildDate:"2019-10-15T19:16:51Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:50:46Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
客户端版本:v1.15.5
服务器版本:v1.18.0
因此使用来更新客户端版本,
➜ ~ curl -LO https://storage.googleapis.com/kubernetes-release/release/<version-here>/bin/darwin/amd64/kubectl
用于安装v1.18.0,
➜ ~ curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/darwin/amd64/kubectl
然后
➜ ~ chmod +x ./kubectl
➜ ~ sudo mv ./kubectl $(which kubectl)
现在检查版本,
➜ ~ kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:58:59Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.0", GitCommit:"9e991415386e4cf155a24b1da15becaa390438d8", GitTreeState:"clean", BuildDate:"2020-03-25T14:50:46Z", GoVersion:"go1.13.8", Compiler:"gc", Platform:"linux/amd64"}
答案 4 :(得分:0)
有时hyperkit链接可能错误并指向旧版本,此类问题可以在mac中修复
<块引用>brew link --overwrite hyperkit