Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I would now like to:

  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?

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.

like image 426
Andy Barron Avatar asked Aug 13 '18 17:08

Andy Barron


Video Answer


1 Answers

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. 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. 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.

like image 112
Ariv Avatar answered Oct 08 '22 16:10

Ariv