Created
February 19, 2024 17:11
-
-
Save spinscale/31b2e9d971403c54be7bca8c9be5d40a to your computer and use it in GitHub Desktop.
Switch default namespaces in k8s
This file contains hidden or 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
function kubens() { | |
ns=$(kubectl get ns | awk '{ print $1 }' | grep -v '^NAME$' | fzf) | |
kubectl config set-context --current --namespace=$ns | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turns out
kubectx
ships withkubens
doing exactly this - it's actually a slightly bigger shell script also using fzf.