How to Change Kubernetes Cluster Context

In this blog post, I will show you how to change the Kubernetes Context cluster.

In my case, I have an AWS EKS Cluster that I use and manage from my machine.

I also have a local Kubernetes Cluster that I enabled on my Docker Client.

Use GUI

Changing the Context is possible using the Docker Desktop GUI and also using the kubectl command line.

To change the context using the GUI, Right click on the Docker icon on the taskbar.

From the settings menu click on the Kubernetes option.

In Context option select the Context you need to use.

Use Kubectl

To change the Kubernetes cluster context using the command line, I will run the following command first to check the current context.

kubectl config current-context

To view all available contexts, I will use the following command.

kubectl config get-contexts

And to change to the Context, I will run the following command.

kubectl config use-context docker-for-desktop

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.