Hello,
I am trying to use the Kubernetes plugin to start Jenkins agents in Google Kubernetes Engine. For server to server applications, Google recommends that you create a GCP service account and then generate a key file (JSON format) for this service account. The key file can then be used to generate short-lived tokens for kubectl.
However, I have been unable to figure out from the documentation how to use this method of authentication with the Kubernetes plugin. I am using gcloud and kubectl commands to deploy applications to Google Kubernetes Engine, so I know that the service account itself has sufficient permissions. (Note that this is a GCP service account, not a kubectl serviceaccount.)
I can retrieve the access token for a service account with
gcloud auth application-default print-access-token
but this token is short-lived and meant for debugging, so it's not very usable.