How to Change Kubernetes Cluster Context

In this blog post, I will show you how to change the Kubernetes Context cluster from a local to an AWS EKS.

In my case, I have an AWS EKS Cluster that I use and manage from my machine, but 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 and click on the Kubernetes option.

From the 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

This blog post was first published on DeployContainers.com


Posted

in

by