Skip to content

Commit

Permalink
Create kubectl-installer.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Prathamkrishna committed Apr 3, 2024
1 parent 6fb7b58 commit 550bf4c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions kubectl/kubectl-installer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
arch=$(uname -i)
if [[ $arch == x86_64* ]]; then
ARCH="amd64"
elif [[ $arch == arm* ]] || [[ $arch = aarch64 ]]; then
ARCH="arm64"
fi
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl"
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/${ARCH}/kubectl.sha256"
echo "$(cat kubectl.sha256) kubectl" | sha256sum --check
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
chmod +x /usr/local/bin/kubectl

0 comments on commit 550bf4c

Please sign in to comment.