Today, I will show you how to switch between contexts in Kubernetes and manage multiple environments from a single machine.
What is Context ?
Context in Kubernetes is like a connection to a server that tells Kubernetes which Cluster to connect to.
When we set the context, Kubernetes will send all the command to the cluster that is set in the context.
To view the current context Kubernetes is using I will use the command below.
kubectl.exe config view
In the screen shot below, you can see the my context is set to use Docker (docker-for-desktop)
To switch to another context, I will use the command below which will switch me to my Minikube cluster
kubectl.exe config use-conext minikube
To view my cluster information, I will run the command below