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