Command

Kubernetes Switch Cluster Context Command

The Kubernetes command to switch cluster context is kubectl config use-context <cluster-name>.

Quick Answer

Command
kubectl config use-context <cluster-name>
KubernetesCommand

Switch Cluster Context

Type this command
kubectl config use-context <cluster-name>

Sets the default context to the named cluster.

Learn More

How to switch cluster context in Kubernetes

  1. Open the terminal or command interface for Kubernetes.
  2. Type kubectl config use-context <cluster-name>, replace any placeholders, and run it.

Kubernetes Switch Cluster Context Command

Run kubectl config use-context <cluster-name>.

Related Commands

Frequently asked questions

What is the Kubernetes command to switch cluster context?

Run kubectl config use-context <cluster-name>.

Where do I type this Kubernetes command?

Type it in the terminal or command-line interface used by Kubernetes.

Does this Kubernetes command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify