尝试部署Jenkins时Oauth范围不足,请点击部署在现有的Google Kubernetes Engine集群上 [英] Insufficient Oauth scope when trying to deploy Jenkins click to deploy on an existing Google Kubernetes Engine cluster

查看:124
本文介绍了尝试部署Jenkins时Oauth范围不足,请点击部署在现有的Google Kubernetes Engine集群上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个现有的Google Kubernetes Engine集群,我想在其中部署Jenkins服务器.

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

GKE提供了一个可以单击以部署我想使用的Jenkins映像的市场,但是当我尝试选择集群时,消息insufficient Oauth scope将该集群标记为不合格集群.

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 insufficient Oauth scope.

我该如何解决?

推荐答案

如果群集没有正确的范围来部署Jenkins服务器,则会由于节点池而出现此错误,不幸的是您无法停止更改节点它们的作用域,IG将使用旧的作用域重新创建这些节点.

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.

要解决此问题,您需要创建具有正确范围的另一个池:

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

--scopes=https://www.googleapis.com/auth/cloud-platform

首先创建一个新的节点池:

First create a new node pool:

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

第二次耗尽旧节点池:

kubectl cordon <NODE_NAME> #This will prevent new pods from being scheduled onto them
kubectl drain <NODE_NAME> --force #This will delete all the pods on that node.

第三次删除旧节点池:

gcloud container node-pools delete default-pool \
   --cluster <YOUR_CLUSTER_NAME> --zone <YOUR_ZONE>

然后在之后部署您的Jenkins服务器. 另一个解决方法,但并不安全,是使用与新作用域几乎相同的群集来创建新的实例模板,您还可以设置完整的API访问权限. 然后在IG中滚动新的更新并选择新的实例模板.

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.

这篇关于尝试部署Jenkins时Oauth范围不足,请点击部署在现有的Google Kubernetes Engine集群上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆