<p>I have an existing Google Kubernetes Engine cluster where I want to deploy a Jenkins server. </p>

<p>GKE offers a marketplace with a click to deploy Jenkins image that I wanted to use but when I try to select my cluster it is marked as ineligible cluster with the message <code>insufficient Oauth scope</code>.</p>

<p>How can I work around this?</p>

codependent
<p>You get this error because of the node pool if your cluster doesn't have the right scopes to deploy the Jenkins server, Unfortunately you cannot stop the nodes to change their scopes, the IG will recreate these nodes with the old scopes.</p>

<p>To get around this problem you need to create another pool with the right scopes:</p>

<pre><code>--scopes=https://www.googleapis.com/auth/cloud-platform
</code></pre>

<p>First create a new node pool: </p>

<pre><code>gcloud container node-pools create adjust-node-scope \
   --cluster &lt;YOUR_CLUSTER_NAME&gt; --zone &lt;YOUR_ZONE&gt; \
   --num-nodes 3 \
   --scopes=https://www.googleapis.com/auth/cloud-platform
</code></pre>

<p>Second drain the old node pool:</p>

<pre><code>kubectl cordon &lt;NODE_NAME&gt; #This will prevent new pods from being scheduled onto them
kubectl drain &lt;NODE_NAME&gt; --force #This will delete all the pods on that node.
</code></pre>

<p>Third delete the old node pool:</p>

<pre><code>gcloud container node-pools delete default-pool \
   --cluster &lt;YOUR_CLUSTER_NAME&gt; --zone &lt;YOUR_ZONE&gt;
</code></pre>

<p>Then deploy your Jenkins server after.
Another workaround but not safe is to create a new instance template almost the same that your cluster is using with the new scopes you can as well setup full API access.
then in IG roll a new update and select the new instances template. </p>
