Home / Companies / Statsig / Blog / Post Details
Content Deep Dive

Optimizing cloud compute costs with GKE and compute classes

Blog post from Statsig

Post Details
Company
Date Published
Author
Pablo Beltran
Word Count
771
Language
English
Hacker News Points
-
Summary

Reducing cloud compute costs without relying on third-party vendors can be achieved by leveraging spot nodes, although challenges such as fluctuating prices and preemption risks persist. An innovative solution involves using GitHub Actions to automate node selection by periodically scraping pricing data and dynamically assigning workloads to the cheapest node types. However, spot nodes can be preempted by cloud providers, potentially disrupting workloads. A strategy to mitigate this involves using a mix of spot and non-spot nodes, with Kubernetes prioritizing cheaper nodes, although this method has limitations due to the nature of autoscaling. A detailed example illustrates the issue of costly drift when workloads shift to more expensive, non-spot nodes over time. Google Kubernetes Engine's (GKE) compute classes offer an effective solution by explicitly defining autoscaling priorities and actively migrating workloads back to cheaper nodes, preventing long-term drift to expensive nodes. The end-to-end automated workflow includes daily price scraping, configuration updates, and continuous deployment, resulting in a significant cost reduction, improved reliability, enhanced performance, and simplified developer workflows by eliminating the need for manual node selection.