8
votes

I have a GKE cluster I'm trying to switch the default node machine type on.

I have already tried:

  1. Creating a new node pool with the machine type I want
  2. Deleting the default-pool. GKE will process for a bit, then not remove the default-pool. I assume this is some undocumented behavior where you cannot delete the default-pool.

I'd prefer to not re-create the cluster and re-apply all of my deployments/secrets/configs/etc.

k8s version: 1.14.10-gke.24 (Stable channel)

Cluster Type: Regional

2

2 Answers

8
votes

The best approach to change/increase/decrease your node pool specification would be with:

  • Migration

To migrate your workloads without incurring downtime, you need to:

  • Create a new node pool.
  • Mark the existing node pool as unschedulable.
  • Drain the workloads running on the existing node pool.
  • Check if the workload is running correctly on a new node pool.
  • Delete the existing node pool.

Your workload will be scheduled automatically onto a new node pool.

Kubernetes, which is the cluster orchestration system of GKE clusters, automatically reschedules the evicted Pods to the new node pool as it drains the existing node pool.

There is official documentation about migrating your workload:

This tutorial demonstrates how to migrate workloads running on a GKE cluster to a new set of nodes within the same cluster without incurring downtime for your application. Such a migration can be useful if you want to migrate your workloads to nodes with a different machine type.

-- GKE: Migrating workloads to different machine types

Please take a look at above guide and let me know if you have any questions in that topic.

0
votes

Disable the default-pool's autoscaler and set the pool size to 0 nodes.

Wish there was a way I could just switch the machine type on the default-pool...