I have got a Google Cloud IAM service account key file (in json format) that contains below data.
{
"type": "service_account",
"project_id": "****",
"private_key_id":"****",
"private_key": "-----BEGIN PRIVATE KEY----blah blah -----END PRIVATE KEY-----\n",
"client_email": "*****",
"client_id": "****",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth/v1/certs",
"client_x509_cert_url": "****"
}
I can use this service account to access kubernetes API server by passing this key file to kube API client libraries.
But, I'm not finding any way to pass this service account to kubectl binary to have kubectl get authenticated to project for which this service account created for.
Is there any way that I can use to make Kubectl to use this service account file for authentication ?