skip to Main Content

How to switch to a different Kubernetes context or namespace?

To list available contexts:

kubectl config get-contexts

To show the current context:

kubectl config current-context

To switch to a new context:

kubectl config use-context my-cluster-name

To switch to a new namespace:

kubectl config set-context --current --namespace=my-namespace

See more at the kubectl Cheat Sheet.

I occasionally blog about programming (.NET, Node.js, Java, PowerShell, React, Angular, JavaScript, etc), gadgets, etc. Follow me on Twitter for tips on those same topics. You can also find me on GitHub.

See About for more info.

This Post Has 0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top