Search code examples
google-cloud-platformkubectldocker-desktop

kubectl is trying to connect to gcloud instead of docker desktop


My kubectl is connecting to GCP by default. I was trying few changes locally and deploying to Docker Desktop Kubernetes.

I remember it was working earlier. But recently when this is executed:

kubectl get pods

It gives-

WARNING: the gcp auth plugin is deprecated in v1.22+, unavailable in v1.25+; use gcloud instead. To learn more, consult https://cloud.google.com/blog/products/containers-kubernetes/kubectl-auth-changes-in-gke

Any clue how to fix this kubectl error and let it show Kubernetes stuffs from Docker Desktop also.


Solution

  • I was able to solve it by switching the context to docker-desktop. Now it shows from Docker Desktop Kubernetes instead connecting to GCP.

    kubectl config use-context docker-desktop