Skip to content

Instantly share code, notes, and snippets.

@wnke
Last active March 21, 2020 12:10
Show Gist options
  • Save wnke/ab3be2f2640fb3692a8c2a588590d366 to your computer and use it in GitHub Desktop.
Save wnke/ab3be2f2640fb3692a8c2a588590d366 to your computer and use it in GitHub Desktop.
kubernetes utils setup #kubernetes #kubens #kubectx
##kubectx and kubens
#change to /opt
cd /opt
#download kubens and kubectx
sudo git clone https://github.com/ahmetb/kubectx.git
#create symlinks
sudo ln -s /opt/kubectx/kubectx /usr/local/bin/kubectx
sudo ln -s /opt/kubectx/kubens /usr/local/bin/kubens
#add to .bashrc
#alias
alias kns=kubens
#alias kctx=kubectx
#bash complitions
source /opt/kubectx/completion/kubectx.bash
source /opt/kubectx/completion/kubens.bash
## kube-ps1
#change to /opt
cd /opt
#download
sudo git clone https://github.com/jonmosco/kube-ps1
#add to bashrc
source /path/to/kube-ps1.sh
PS1='[\u@\h \W $(kube_ps1)]\$ '
##stern multipod logs
# check for the latest release https://github.com/wercker/stern/releases
cd /tmp
wget https://github.com/wercker/stern/releases/download/1.11.0/stern_linux_amd64
#make exec
chmod +x stern_linux_amd64
#copy to /usr/local/bin/
sudo mv stern_linux_amd64 /usr/local/bin/stern
#add to .bashrc completions
source <(stern --completion=bash)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment