如何升级 kubectl 客户端版本 [英] How to upgrade kubectl client version
问题描述
我想将 kubectl 客户端版本升级到 1.11.3.
I want to upgrade the kubectl client version to 1.11.3.
我执行了 brew install kubernetes-cli
但版本似乎没有更新.
I executed brew install kubernetes-cli
but the version doesnt seem to be updating.
Client Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.7", GitCommit:"0c38c362511b20a098d7cd855f1314dad92c2780", GitTreeState:"clean", BuildDate:"2018-08-20T10:09:03Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.4", GitCommit:"bf9a868e8ea3d3a8fa53cbb22f566771b3f8068b", GitTreeState:"clean", BuildDate:"2018-10-25T19:06:30Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"linux/amd64"}
我正在尝试通过运行此命令来获取单元格的日志.
I'm trying to get the logs for a cell by running this command.
kubectl logs -l groupname/cell=my-cell --all-containers=true
这适用于我的客户端版本为 1.11.3 的 VM.但是在我的 mac 中,它给了我一个错误,说 --all-containers=true
标志对于 kubectl logs
命令不可用.
This works in my VM which has client version 1.11.3. But in my mac it gives me an error saying --all-containers=true
flag is not available for kubectl logs
command.
推荐答案
安装特定版本的 kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/
对于您的情况,如果您想安装 v1.11.3
版本,请将 specific-kubectl-version 替换为 v1.11.3
For your case if you want to install version v1.11.3
then replace specific-kubectl-version with v1.11.3
然后使这个二进制可执行
Then make this binary executable
chmod +x ./kubectl
然后将此二进制文件移动到您的PATH
Then move this binary to your PATH
sudo mv ./kubectl $(which kubectl)
这篇关于如何升级 kubectl 客户端版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!