Switching Between Different Kubernetes Clusters

I'm sure you're only here because you cannot remember the command to switch between contexts on the command line right?

· 1 min read

So you have more than one cluster, perhaps one for staging and one for production? I'm sure you're only here because you cannot remember the command to switch between contexts on the command line right?

Well here it is!

Show the current Context:

kubectl config current-context
Show Current Context

Display all the Contexts in a kubeconfig file:

kubectl config get-contexts
Display Contents In Config File

Switch to a different Context:

kubectl config use-context <context-name>
Switch To Different Context

Related Articles

Deploying Sendy On Kubernetes
· 30 min read