Why it matters
N1 is still the default in many older templates and node pools. For general workloads E2 does the same job for less, and the move is a machine-type change, not a redesign.How nOps finds it
nOps reads the last 7 complete days of Compute Engine billing for N1 predefined and custom vCPU and memory. Usage is grouped by GKE node pool, or for other VMs by instance name (without the random suffix) and machine type. A group is flagged when it ran on all 7 days and in the last 2 days, has no GPUs, local SSD or committed-use discount, and no instance is larger than E2 allows (more than 32 vCPUs, or an n1-highmem type over 16 vCPUs). The current cost is the N1 cost after sustained-use discounts. E2 is priced at your own billed E2 rate in that location, or 72.5% of your N1 cost, whichever is higher. The saving is the difference, at least $5 a month. Projects whose spend on the service is at least 90% paid by credits or promotions are left out.Before you start
Permission to change instance templates, instances or GKE node pools in the project.How to implement
- Pick the E2 machine type with the same vCPUs and memory (for example, n1-standard-4 to e2-standard-4). For custom N1 types, use an E2 custom type.
- GKE node pool: create a new node pool with the E2 machine type (
gcloud container node-pools create --machine-type=e2-...), cordon and drain the N1 nodes, then delete the N1 pool. - Managed instance group: create a new instance template with the E2 type and start a rolling update to it.
- Single VM: stop it, change the machine type (
gcloud compute instances set-machine-type VM_NAME --machine-type=e2-... --zone=ZONE), then start it. - Update Terraform or Deployment Manager so the next deployment does not change it back.
Risks and considerations
- E2 has no sustained-use discounts, GPUs or local SSD, and its CPUs are shared across a pool, so check CPU-sensitive workloads after the move.
- Changing the machine type of a single VM needs a stop and start.
- To roll back, move the node pool, template or VM back to the N1 type.
FAQs
Why does nOps take the higher of two E2 prices?
Why does nOps take the higher of two E2 prices?
To avoid overstating the saving. Your own E2 rate is used when you already run E2 in that location, but never below 72.5% of your N1 cost, the least favourable E2 to N1 price ratio across regions.
Why are N1 instances with a committed-use discount left out?
Why are N1 instances with a committed-use discount left out?
Resource-based commitments are bought for a machine family. Moving off N1 could leave the commitment unused.