Skip to content

Instantly share code, notes, and snippets.

@mkfsn
Created December 30, 2020 05:59
Show Gist options
  • Select an option

  • Save mkfsn/2fa68df3c6d4518f0738549b639e8fa1 to your computer and use it in GitHub Desktop.

Select an option

Save mkfsn/2fa68df3c6d4518f0738549b639e8fa1 to your computer and use it in GitHub Desktop.
Kubernetes Fish Shell Customizations
# https://medium.com/better-programming/4-simple-kubernetes-terminal-customizations-to-boost-your-productivity-deda60a19924
# Using theme bobthefish: https://github.com/oh-my-fish/theme-bobthefish
set -g theme_display_k8s_context yes
set -g theme_display_k8s_namespace yes
alias k='kubectl'
function ksn
if test (count $argv) -lt 1; or test $argv[1] = "--help"
echo "ksn NAMESPACE"
return
end
if k get namespace $argv[1] > /dev/null
echo "NAMESPACE '$argv[1]' not found"
return $status
end
k config set-context (k config current-context) --namespace=$argv[1];
echo "Namespace: $argv[1]"
end
funcsave ksn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment