0
votes

I have the latest 1.6.4 Kubernetes installed on my GCP cluster but cannot figure out how to give Jenkins authorization.

i just tried adding two new commands in jenkins file

sh(“gcloud config set compute/zone us-central1-b”)

sh(“gcloud container clusters get-credentials te-cluster”)

1st was successful second one failed

ERROR: (gcloud.container.clusters.get-credentials) ResponseError: code=403, message=Request had insufficient authentication scopes.

1

1 Answers

0
votes

First create credentials using following: Navigate to Google Cloud API Manager > Credentials > Create Credentials and create a JSON key for the Compute Engine default service account.

Then use gcloud auth activate-service-account --key-file key.json

You can save the content of the json file to a variable