背景
最近工作中使用到了k8s,需要看日志,分析定位问题,故学习分享
一、用 Homebrew 在 macOS 系统上安装
# 如果你是 macOS 系统,且用的是 Homebrew 包管理工具, 则可以用 Homebrew 安装 kubectl。
# 运行安装命令安装最新版本kubectl
brew install kubectl
# 或
brew install kubernetes-cli
# 测试一下,确保你安装的是最新的版本:
kubectl version --client
# 安装指定版本
For example, to download version v1.21.14 on Intel macOS, type:
curl -LO "https://dl.k8s.io/release/v1.21.14/bin/darwin/amd64/kubectl"
And for macOS on Apple Silicon, type: