Skip to content

Instantly share code, notes, and snippets.

@thbkrkr
Created March 31, 2025 21:12
Show Gist options
  • Save thbkrkr/8676bca9d3bf90753e709146feacaf8e to your computer and use it in GitHub Desktop.
Save thbkrkr/8676bca9d3bf90753e709146feacaf8e to your computer and use it in GitHub Desktop.
tsh ktsh aliases to use separate kube config file
#> grep KUBECONFIG ~/.myzshrc
alias tsh='KUBECONFIG=~/.kube/tsh-config /opt/homebrew/bin/tsh'
alias ktsh='export KUBECONFIG=~/.kube/tsh-config'
#> grep -A2 -B1 k8s ~/.oh-my-zsh/themes/pure-thb.zsh-theme
# show [k8s:<name>]
part1=""
if [[ "${KUBECONFIG:-}" != "" ]]; then
kctx="$(grep current-context ${KUBECONFIG} | cut -d ' ' -f2)"
part1="[%F{red}k8s%f:%F{cyan}$kctx%f] "
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment