<p>I have a gke cluster with a running jenkins master. I am trying to start a build. I am using a pipeline with a slave configured by the kubernetes plugin (pod Templates). I have a custom image for my jenkins slave published in gcr (private access). I have added credentials (google service account) for my gcr to jenkins. Nevertheless jenkins/kubernetes is failing to start-up a slave because the image can't be pulled from gcr. When I use public images (jnlp) there is no issue.
But when I try to use the image from gcr, kubernetes says:</p>

<pre><code>Failed to pull image "eu.gcr.io/&lt;project-id&gt;/&lt;image name&gt;:&lt;tag&gt;": rpc error: code = Unknown desc = Error response from daemon: unauthorized: You don't have the needed permissions to perform this operation, and you may have invalid credentials. To authenticate your request, follow the steps in: https://cloud.google.com/container-registry/docs/advanced-authentication
</code></pre>

<p>Although the pod is running in the same project as the gcr. </p>

<p>I would expect jenkins to start the slave even if I use a image from gcr.</p>

Stephan
<p>Even if the pod is running in a cluster in the same project, is not authenticated by default.</p>

<p>Is stated that you've already set up the Service Account and I assume that <a href="https://cloud.google.com/iam/docs/creating-managing-service-account-keys#creating_service_account_keys" rel="nofollow noreferrer">there's a furnished key</a> in the Jenkins server.</p>

<p>If you're using the <a href="https://wiki.jenkins.io/display/JENKINS/Google+OAuth+Plugin" rel="nofollow noreferrer">Google OAuth Credentials Plugin</a> you can then also use the <a href="https://wiki.jenkins.io/display/JENKINS/Google+Container+Registry+Auth+Plugin" rel="nofollow noreferrer">Google Container Registry Auth Plugin</a> to <a href="https://medium.com/google-cloud/how-to-push-docker-image-to-google-container-registry-gcr-through-jenkins-job-52b9d5ce9f7f" rel="nofollow noreferrer">authenticate to a private GCR repository and pull the image</a>.</p>
