zilcuanu
zilcuanu

Reputation: 3715

reset the kubectl context to docker desktop

I have installed docker desktop on my windows 10 and have enabled Kubernetes. When I run the kubectl config current-context command I am getting this response gke_k8s-demo-263903_asia-south1-a_kubia. How do I set up the context to point to docker-desktop? I remember that I had worked with GKE earlier but not sure how to reset the context.

Upvotes: 6

Views: 13984

Answers (3)

juanmirocks
juanmirocks

Reputation: 6239

If you don't have any docker-desktop kubernetes context at all, you need likely to create it for the first time or otherwise to reset it; see: https://docs.docker.com/desktop/kubernetes/#turn-on-kubernetes

Summary:

  1. From the Docker Dashboard (Docker Desktop app), select Settings.
  2. Select Kubernetes from the left sidebar.
  3. Next to Enable Kubernetes, select the checkbox.
  4. Select Apply & Restart to save the settings and then select Install to confirm.

Upvotes: 4

H6_
H6_

Reputation: 32857

One additional note: If you have accidentally deleted the docker-desktop context from your ~/.kube/config you can re-create it when restarting the docker/Kubernetes Engine in the Docker-Desktop application.

Upvotes: 5

m8usz
m8usz

Reputation: 466

From your local machine run, you should see docker-desktop listed:

kubectl config get-contexts

Then run the below:

kubectl config use-context docker-desktop

If the cluster name you want to communicate with is not listed, it means you haven't got to context file to the cluster.

Upvotes: 31

Related Questions