Problems in connection when I try to connect GKE cluster using kubectl

7/31/2019

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?

-- tank
gcloud
google-kubernetes-engine
kubectl
kubernetes

1 Answer

7/31/2019

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.

-- DazWilkin
Source: StackOverflow