0
votes

I have a running cluster on Google Cloud Kubernetes engine and I want to access that using kubectl from my local system.

I tried installing kubectl with gcloud but it didn't worked. Then I installed kubectl using apt-get. When I try to see the version of it using kubectl version it says

Unable to connect to server EOF. I also don't have file ~/.kube/config, which I am not sure why. Can someone please tell me what I am missing here? How can I connect to the already running cluster in GKE?

1
I did an Internet search for the phrase “connect GKE cluster using kubectl” from the title of your post, and immediately saw this GKE doc page: cloud.google.com/kubernetes-engine/docs/how-to/…. I always use those instructions and they work. Have you tried them? Did you run any of the specific commands and get unexpected failure results?Amit Kumar Gupta

1 Answers

1
votes

gcloud container clusters get-credentials ... will auth you against the cluster using your gcloud credentials.

If successful, the command adds appropriate configuration to ~/.kube/config such that you can kubectl.