简体   繁体   English

GKE:修改现有集群 - 删除节点标签并更改网络

[英]GKE: Modify existing cluster - remove node tags and change network

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

I would now like to: 我现在想:

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

Are either of these operations possible, or will I have to re-create the cluster? 是否可以执行这些操作,还是必须重新创建群集?

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. 对于上下文,我使用节点标记和网络规则通过作为NAT网关的单个GCE实例路由传出网络流量。 I now want to turn this routing off. 我现在想要关掉这个路由。

Currently, its not possible to update cluster network and remove tags for existing cluster using the gcloud command. 目前,无法使用gcloud命令更新群集网络并删除现有群集的标记。 I have verified this information using the gcloud container clusters update command documentation . 我已使用gcloud容器集群更新命令文档验证了此信息。 Additionally, alpha and beta command don't provide this feature yet. 此外, alphabeta命令尚未提供此功能。 API doc also provides information related to different configuration which can be changed. API doc还提供与可以更改的不同配置相关的信息。

As a workaround, I was able to remove one of the tags using the rolling update feature within the instance group setting: 作为解决方法,我能够使用实例组设置中的滚动更新功能删除其中一个标记:

  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 选择某个群集实例组 - >单击滚动更新 - >将实例模板更改为您创建的 - >更新

If you change the network in step-2, I was not able to select the instance template with the new network in step-3. 如果在步骤2中更改网络,则无法在步骤3中使用新网络选择实例模板。 Changing the tag alone won't solve your purpose, it's better to create a new cluster. 单独更改标记不会解决您的目的,最好创建一个新的集群。

If you are interested to update tags and network using the gcloud command, I suggest creating a feature request (FR) in Public Issue tracker . 如果您有兴趣使用gcloud命令更新标签和网络,我建议在公共问题跟踪器中创建功能请求(FR)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM