Skip to content

Instantly share code, notes, and snippets.

@caruccio
Last active September 12, 2024 15:21
Show Gist options
  • Save caruccio/b9eb86e307ecc293d5b832af8c577605 to your computer and use it in GitHub Desktop.
Save caruccio/b9eb86e307ecc293d5b832af8c577605 to your computer and use it in GitHub Desktop.
Setup basic kubectl bash env
# curl -sL https://gist.github.com/caruccio/b9eb86e307ecc293d5b832af8c577605/raw/kubectl-setup.sh | bash
mkdir -p ~/bin ~/opt
if [ -d ~/opt/kubectx ]; then
cd ~/opt/kubectx
git pull
else
git clone https://github.com/ahmetb/kubectx ~/opt/kubectx
fi
ln -fs ~/opt/kubectx/kubectx ~/bin/kubectx
ln -fs ~/opt/kubectx/kubens ~/bin/kubens
if [ -d ~/opt/autokube ]; then
cd ~/opt/autokube
git pull
else
git clone https://github.com/caruccio/autokube ~/opt/autokube
fi
make -C ~/opt/autokube install-user
if ! [[ "$PATH" =~ (^|.*:)(~/bin/?|$HOME/bin/?)(:.*|$) ]]; then
echo 'PATH=$PATH:~/bin' >> ~/.bashrc
fi
if [ "$(type -t l)" != alias ]; then
alias l='ls -la'
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment