Resize kubernetes cluster with a different machine type?

6,483

Solution 1

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

Solution 2

Share:
6,483

Related videos on Youtube

Mr.Wang from Next Door
Author by

Mr.Wang from Next Door

Updated on September 18, 2022

Comments

  • Mr.Wang from Next Door
    Mr.Wang from Next Door over 1 year

    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?

    • Robert Bailey
      Robert Bailey about 8 years
      This question was previously answered on Stack Overflow.
  • Mr.Wang from Next Door
    Mr.Wang from Next Door about 8 years
    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
    Mr.Wang from Next Door about 8 years
    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
  • DoiT International
    DoiT International about 8 years
    @user325320 - unfortunately, this is the situation today.
  • Federico Fissore
    Federico Fissore over 7 years
    Followed that guide and successfully started migrating pods from one old node to the newer one