Skip to content

Instantly share code, notes, and snippets.

@nicc777
Last active May 9, 2022 19:16
Show Gist options
  • Save nicc777/1475f894261f17dcd5c71b24e3f2f81d to your computer and use it in GitHub Desktop.
Save nicc777/1475f894261f17dcd5c71b24e3f2f81d to your computer and use it in GitHub Desktop.
Get latest kubectl (Linux)
#!/bin/sh
curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl"
mkdir -p ~/opt/bin
chmod 700 kubectl
mv kubectl ~/opt/bin

A short shell script to get the latest kubectl and install it locally on ~/opt/bin - assuming you have that in your PATH.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment