Authenticating Gcloud Kubernetes with just a Service Account kubectl token?

5/24/2018

Following: https://kubernetes.io/docs/reference/access-authn-authz/authentication/#option-2-use-the-token-option

I want to be able to connect to project / cluster context to our GKE clusters.

Normally, one would use gcloud, and login with a browser, or with a password json file.

Is it possible to authenticate with just a service account token that you can feed into kubectl (without using gcloud)?

I cannot get the above documentation working, doesn't seem to connect me to gcloud as I get:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

Never able to connect outside of a local context.

I'm wondering if this is even possible, to connect to GKE clusters using nothing but a service account token?

-- yellowarchangel
command-line-interface
gcloud
kubernetes

0 Answers