Last active
September 12, 2024 15:21
-
-
Save caruccio/b9eb86e307ecc293d5b832af8c577605 to your computer and use it in GitHub Desktop.
Setup basic kubectl bash env
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
# 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