-
-
Save karael/6ba7fee569aa13d2d1ce83ee141141f7 to your computer and use it in GitHub Desktop.
Get latest kubectl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Finding latest kubectl..." | |
# curl -s https://github.com/kubernetes/kubernetes/releases/latest | awk -F '[<>]' '/.*/ { match($0, "tag/([^\"]+)",a); print a[1] }' | |
LATEST=$(wget -qO- https://github.com/kubernetes/kubernetes/releases/latest | awk -F '[<>]' '/href="\/kubernetes\/kubernetes\/tree\/.*"/ { match($0, "tree/([^\"]+)",a); print a[1] }' | head -1) | |
echo "Getting $LATEST..." | |
sudo wget -NP /usr/bin http://storage.googleapis.com/kubernetes-release/release/$LATEST/bin/linux/amd64/kubectl | |
sudo chmod 755 /usr/bin/kubectl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment