Skip to content

Instantly share code, notes, and snippets.

@naingyeminn
Created December 15, 2023 07:53
Show Gist options
  • Save naingyeminn/d62429162ab559dd9455ec23451b6753 to your computer and use it in GitHub Desktop.
Save naingyeminn/d62429162ab559dd9455ec23451b6753 to your computer and use it in GitHub Desktop.
#!/bin/bash
kubedl() {
echo "Downloading ${2} v${1}..."
curl -LO --progress-bar https://dl.k8s.io/v${1}/bin/linux/amd64/${2}
check ${1} ${2}
mkdir -p "v${1}"
mv ${2} "v${1}/"
}
check() {
echo $(curl -sL https://dl.k8s.io/v${1}/bin/linux/amd64/${2}.sha256) ${2} | sha256sum -c || kubedl ${1} ${2}
}
kubedl ${1} kubelet
kubedl ${1} kubeadm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment