5

I want to add a new node in existing kubernetes cluster, but with a different machine type. For the new node I will add label for it so that only some application will run on it.

I tried the following command

gcloud compute instance-groups managed resize CONTAINER_GROUP --zone ZONE --size 5 --machine-type n1-standard-8

And it returns an error

ERROR: (gcloud.compute.instance-groups.managed.resize) unrecognized arguments: --machine-type n1-standard-8

How can I add a new node into existing kubernetes cluster with a different machine type?

2

You can work around the single machine-type restriction by creating a new instance group with a (modified) copy of GKE's instance template. See this answer for more details. Note that later you may need to manually upgrade that instance group (instead of using GKE's Node Upgrade API).

7
  • 1
    Followed that guide and successfully started migrating pods from one old node to the newer one – Federico Fissore Nov 3 '16 at 11:08
0

This is something not available today with Google Container Engine. You can only have identical nodes in the cluster.

Generally, you can change the instance type but not when instance is part of the instance group. Even if you could change the instance type in the instance group (which you can't), the GKE doesn't support yet mixed clusters.

  • But the doc says I can change the machine type of a stopped node. I tried that and it says ERROR: (gcloud.compute.instances.set-machine-type) Some requests did not succeed: - The resource 'xxxx' is not ready. So Google disabled that? – Mr.Wang from Next Door Mar 16 '16 at 12:59
  • Generally, you can change the instance type but not when instance is part of the instance group. Even if you could change the instance type in the instance group (which you can't), the GKE doesn't support yet mixed clusters. – Vadim Solovey Mar 16 '16 at 13:06
  • So if I want to upgrade the machine type, I need create a new cluster? Seems unreasonable for production environment since that would lead to downtime – Mr.Wang from Next Door Mar 16 '16 at 13:11
  • @user325320 - unfortunately, this is the situation today. – Vadim Solovey Mar 16 '16 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.