I'm trying to setup a continuous integration job that will deploy to kubernetes / google container engine from a Jenkins job. The jenkins server is relatively tightly controlled, so I'm not able to install plugins.
I have a JSON key file for a server account from Google Cloud IAM.
I'm currently trying to download the google cloud sdk and auth from there, but am not having any luck (this if from a Jenkinsfile):
sh 'export KUBECONFIG=$(pwd)/.kubeconfig'
sh 'export GOOGLE_APPLICATION_CREDENTIALS=$JSON'
sh 'google-cloud-sdk/bin/gcloud auth activate-service-account --key-file=$JSON'
sh 'google-cloud-sdk/bin/gcloud config set core/project proj-1'
sh 'google-cloud-sdk/bin/gcloud container clusters list'
sh 'google-cloud-sdk/bin/gcloud container clusters get-credentials clust-1 --zone us-east1-c'
sh 'kubectl get pods'
I'm getting the error message: error: google: could not find default credentials. See https://developers.google.com/accounts/docs/application-default-credentials for more information. I will also need to be able to do a gcloud docker push, so using gcloud is ok.