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:
--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
.)--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.
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:
- Go to instance template of some-cluster -> select the template
- Click (copy from the top of instance template)-> Remove the tag -> creates a new template
- 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With