Connect kubectl to Google Compute Engine Kubernetes installation

2/1/2018

I have followed this for installing Kubernetes using googles web shell.

Now if I would like to use the Terminal on Mac, how do I connect kubectl to the master GCE - I can not use gcloud container clusters get-credentials [CLUSTER_NAME] as I did not creatre a Cluster engine but installed Kubernetes via cluster/kube-up.sh

Do you know how to connect kubectl from Mac terminal to the installation on Google Compute Engine?

Thanks

-- Chris G.
google-compute-engine
kubernetes

1 Answer

2/6/2018

kubectl gets it's configuration from a "kubeconfig" file, usually ~/.kube/config. This file is written by kube-up.sh, so if you used kube-up on a different system you should be able to copy the kubeconfig file from that machine to your Mac and then use kubectl normally.

-- David
Source: StackOverflow