Cloud-builders: kubectl builder doesn't work

Created on 24 Jul 2018  路  2Comments  路  Source: GoogleCloudPlatform/cloud-builders

this step doesn't work for me in my project,

steps:

  • name: 'gcr.io/cloud-builders/kubectl'
    args: ['get', 'pods']
    env:

    • 'CLOUDSDK_COMPUTE_ZONE=us-east4-b'

    • 'CLOUDSDK_CONTAINER_CLUSTER=your-cluster'

I set this up, but I've got this:

Step #2: Already have image (with digest): gcr.io/cloud-builders/kubectl
Step #2: Running: gcloud container clusters get-credentials --project="env-" --zone="europe-west1-b" "-env-dev"
Step #2: Fetching cluster endpoint and auth data.
Step #2: ERROR: (gcloud.container.clusters.get-credentials) ResponseError: code=403, message=Required "container.clusters.get" permission for "projects/env-/zones/europe-west1-b/clusters/-env-dev".
Finished Step #2

In console the same command works fine:

Fetching cluster endpoint and auth data.
kubeconfig entry generated for -env-dev.

Most helpful comment

I think the error message is saying that the Cloud Builder service doesn't have access to your GKE clusters. You might want to double check the IAM permissions for Cloud Builder that are described here: https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/kubectl#using-this-builder-with-google-kubernetes-engine.

All 2 comments

I think the error message is saying that the Cloud Builder service doesn't have access to your GKE clusters. You might want to double check the IAM permissions for Cloud Builder that are described here: https://github.com/GoogleCloudPlatform/cloud-builders/tree/master/kubectl#using-this-builder-with-google-kubernetes-engine.

I believe that @leejones explanation will resolve this issue @sneerin , so I'm marking as closed. Feel free to re-open if I am incorrect.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

larssb picture larssb  路  6Comments

govindrai picture govindrai  路  5Comments

acasademont picture acasademont  路  4Comments

jredl-va picture jredl-va  路  3Comments

ewhauser picture ewhauser  路  4Comments