Skip to content

Instantly share code, notes, and snippets.

@hbasria
Created June 25, 2024 18:38
Show Gist options
  • Save hbasria/4d64142a1732e9955d9b3e83379e5b12 to your computer and use it in GitHub Desktop.
Save hbasria/4d64142a1732e9955d9b3e83379e5b12 to your computer and use it in GitHub Desktop.
kubectl switch namespace and context
$ alias kubens='kubectl config set-context --current --namespace '
$ alias kubectx='kubectl config use-context '
// Usage
$ kubens kube-system //Switch to a different namespace
$ kubectx docker //Switch to separate context
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment