# 最新版本:
VERSION=`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`
# 指定版本:
VERSION=v1.9.0
curl -LO https://storage.googleapis.com/kubernetes-release/release/${VERSION}/bin/darwin/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
# 最新版本:
VERSION=`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`
# 指定版本:
VERSION=v1.9.0
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x ./kubectl
sudo mv ./kubectl /usr/local/bin/kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/windows/amd64/kubectl.exe
kubectl更多获取方式
VERSION=curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt
#版本列表 https://github.com/kubernetes/kubernetes/releases
wget https://github.com/kubernetes/kubernetes/releases/download/${VERSION}/kubernetes.tar.gz
tar xf kubernetes.tar.gz
./cluster/get-kube-binaries.sh
该脚本实际上下载了以下两个tar包
#推荐
VERSION=`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`
wget https://dl.k8s.io/${VERSION}/kubernetes-client-linux-amd64.tar.gz
wget https://dl.k8s.io/${VERSION}/kubernetes-server-linux-amd64.tar.gz
tar xf kubernetes-client-linux-amd64.tar.gz && tar xf kubernetes-server-linux-amd64.tar.gz
find ./kubernetes -perm /111 -and -type f -exec cp {} /usr/local/bin/ \;
git clone https://github.com/kubernetes/kubernetes.git
cd kubernetes
make release
# wget version
export KUBERNETES_PROVIDER=YOUR_PROVIDER; wget -q -O - https://get.k8s.io | bash
# curl version
export KUBERNETES_PROVIDER=YOUR_PROVIDER; curl -sS https://get.k8s.io | bash