关于GKE Node Scope的更改

最近碰到一种情况,就是已经创建的GKE的scope缺少访问Bigquery的权限。从界面上是没法解决,而我又不想更改重新生成cluster。 谷歌到一篇比较有用的处理方式。大致是重新创建一个Node pool并且给予合适的权限,然后再把部署的pod转移过去: https://adilsoncarvalho.com/changing-a-running-kubernetes-cluster-permissions-a-k-a-scopes-3e90a3b95636

gcloud container node-pools create default-node --region=<region> --cluster <cluster-name> --enable-autoscaling --machine-type n1-standard-8 --disk-type pd-ssd --max-nodes 4 --min-nodes 1 --node-locations=<node-location-list> --image-type=COS --enable-autorepair --no-enable-autoupgrade --scopes=gke-default,bigquery --service-account=<service-account-name>

kubectl drain [node]

gcloud container node-pools delete [POOL_NAME]
--cluster [CLUSTER_NAME]

个人尝试了一下,还是蛮好用的。

原文地址:https://www.cnblogs.com/move-on/p/14200828.html