Skip to content

Instantly share code, notes, and snippets.

@tdlmatias
Created December 20, 2019 10:42
Show Gist options
  • Save tdlmatias/bf620fbf594c25fc64ee5039208639de to your computer and use it in GitHub Desktop.
Save tdlmatias/bf620fbf594c25fc64ee5039208639de to your computer and use it in GitHub Desktop.
#!/bin/bash
############################
## Edited by TdlMatias #####
############################
# Script to install Kubectl
############################
KUBECTL_BIN=kubectl
function install_kubectl {
if [ -z $(which $KUBECTL_BIN) ]
then
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/$KUBECTL_BIN
chmod +x ${KUBECTL_BIN}
sudo mv ${KUBECTL_BIN} /usr/local/bin/${KUBECTL_BIN}
else
echo "Kubectl is most likely installed"
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment