From a VM in GCE, I did the following
gcloud auth activate-service-account --key-file
# \"blah\" is a service account key file (JSON) I generate
If you are using The Google Kubernetes Engine API from a VM in GCP. You first need to add required scope at vm level https://www.googleapis.com/auth/projecthosting,cloud-platform. This can be done by GCP console as well. Stop the VM instance then go to edit option and at the end you will find Cloud API access scopes.