link: https://github.com/kubernetes/kubernetes
KUBE_URI="kubernetes/kubernetes"
kube_latest=$(curl -L --silent "https://api.github.com/repos/${KUBE_URI}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/' | sed 's/^.//')
echo $kube_latest
KUBE_URI="kubernetes/kubernetes"
ARCH="amd64"
DEST=$PWD
DOWNLOAD_DIR="/usr/local/bin"
STABLE_RELEASE="$(curl -sSL https://dl.k8s.io/release/stable.txt)"
echo "Officail stable release kube version = ${STABLE_RELEASE}"
kube_latest=$(curl -L --silent "https://api.github.com/repos/${KUBE_URI}/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
echo "Github latest release kube version = $kube_latest"
KUBE_VERSION=$STABLE_RELEASE
echo or
KUBE_VERSION=$kube_latest
cd $DEST
curl -v -LO --remote-name-all "https://storage.googleapis.com/kubernetes-release/release/${KUBE_VERSION}/bin/linux/${ARCH}/{kubeadm,kubelet,kubectl}"
chmod +x {kubeadm,kubelet,kubectl}