GKE:修改现有集群-删除节点标签并更改网络 [英] GKE: Modify existing cluster - remove node tags and change network

查看:108
本文介绍了GKE:修改现有集群-删除节点标签并更改网络的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下CLI命令创建了一个Kubernetes集群: gcloud container clusters create some-cluster --tags=some-tag --network=some-network

I created a Kubernetes cluster with the following CLI command: gcloud container clusters create some-cluster --tags=some-tag --network=some-network

我现在要:

  1. 禁用--tags选项,以便在没有标签some-tag的情况下创建新节点/VM. (可选:通过gcloud compute instances remove-tags可以从现有计算机上删除标签.)
  2. 禁用--network标志,将群集返回到默认的GCP网络.
  1. Disable the --tags option, so that new nodes/VMs are created without the tag some-tag. (Optional: Remove the tag from existing machines, which should be possible through gcloud compute instances remove-tags.)
  2. Disable the --network flag, returning the cluster to the default GCP network.

这些操作是否可行,还是我必须重新创建集群?

Are either of these operations possible, or will I have to re-create the cluster?

对于上下文,我使用节点标记和网络规则通过作为NAT网关的单个GCE实例路由传出网络流量.我现在想关闭此路由.

For context, I was using the node tags and networking rules to route outgoing network traffic through a single GCE instance serving as a NAT gateway. I now want to turn this routing off.

推荐答案

当前,无法使用gcloud命令更新集群网络并删除现有集群的标签.我已经使用gcloud容器集群更新命令文档.此外, alpha

Currently, its not possible to update cluster network and remove tags for existing cluster using the gcloud command. I have verified this information using the gcloud container clusters update command documentation. Additionally, alpha and beta command don't provide this feature yet. API doc also provides information related to different configuration which can be changed.

作为一种解决方法,我能够使用实例组设置中的滚动更新功能删除其中一个标签:

As a workaround, I was able to remove one of the tags using the rolling update feature within the instance group setting:

  1. 转到some-cluster的实例模板->选择模板
  2. 点击(从实例模板顶部复制)->删除标签->创建新模板
  3. 选择一个集群实例组->单击滚动更新->将实例模板更改为您创建的实例模板->更新
  1. Go to instance template of some-cluster -> select the template
  2. Click (copy from the top of instance template)-> Remove the tag -> creates a new template
  3. Select the some-cluster Instance Group-> click on rolling update -> change the instance template to the one you created -> update

如果您在步骤2中更改了网络,则无法在步骤3中选择具有新网络的实例模板.仅仅更改标签并不能解决您的目的,最好创建一个新集群.

If you change the network in step-2, I was not able to select the instance template with the new network in step-3. Changing the tag alone won’t solve your purpose, it's better to create a new cluster.

如果您有兴趣使用gcloud命令更新标签和网络,建议您在

If you are interested to update tags and network using the gcloud command, I suggest creating a feature request (FR) in Public Issue tracker.

这篇关于GKE:修改现有集群-删除节点标签并更改网络的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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