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?

  • This question was previously answered on [Stack Overflow](http://stackoverflow.com/questions/31302233/resize-instance-types-on-container-engine-cluster/31303169#31303169). – Robert Bailey Mar 16 '16 at 17:14

3 Answers3

7
Nitin
  • 181
  • 1
  • 4
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).

CJ Cullen
  • 261
  • 1
  • 3
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](https://cloud.google.com/compute/docs/instances/changing-machine-type-of-stopped-instance) 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. – DoiT International 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. – DoiT International Mar 16 '16 at 15:01