4 low-effort, high-impact ways to cut your GKE costs (and your carbon footprint)
Roman Arcea
Product Manager, GKE
Gari Singh
Product Manager
Try Google Cloud
Start building on Google Cloud with $300 in free credits and 20+ always free products.
Free trialControlling cloud costs is always top-of-mind for organizations. But how? It can be difficult to surface wasted resources and figure out how best to optimize them without sacrificing performance or availability.
Here on the Google Kubernetes Engine (GKE) team, weâre eager to help in any way we can. And after participating in some recent capacity planning exercises of our own, we couldnât help but notice that there are some low-hanging fruit when it comes to optimization opportunities: According to our internal research, up to one in ten of clusters across the GKE fleet is idle at any given time. Further, among over-provisioned workloads, 40% of them have provisioned 30 times the resources they actually use â and 11% of workloads have provisioned over 100 times the needed resources.Â
Thankfully, there are many best practices for reclaiming this wasted capacity, many of which weâve built directly into GKE. Read on for four low-effort, high-reward ways to reclaim resources and optimize your GKE spend. As an added bonus, when you reclaim wasted resources and implement these techniques, youâre also minimizing management overhead â and reducing your carbon footprint!
Letâs dive in.
Strategy 1: Activate the âoptimize-utilizationâ profile in the GKE cluster autoscaler
Level: EasyÂ
Impact: Medium
Rightsizing vCPU and memory is one of the primary ways to save on GKE costs. The online UK-based, carpooling marketplace BlaBlaCar recently went through the process and saw their CPU utilization go from 25% to 53%. GKE provides several built-in tools to help you do the same. For example, GKE cluster autoscaler supports several mechanisms for automatically resizing a clusterâs node pools based on the demands on your workload, which you can apply by specifying an autoscaler profile. After analyzing our customersâ clusters across the GKE fleet, we estimate that activating the optimize-utilization profile can reduce unallocated vCPU and memory by 20% on average. For most clusters, it is a flip of a switch that has no impact on application behavior or performance, but that could significantly reduce the number of vCPUs and/or VMs that you need.
Steps you should take:
Learn about the optimize-utilization profile by watching this video guide.
Read the documentation to learn how to activate it.
Activate it on your existing (and new) clusters.
....reduce unallocated vCPU and memory by 20% on average.
Strategy 2: Shut down idle clusters
Level: EasyÂ
Impact: Medium-High
Turn off what youâre not using. This is a no-brainer, yet, among the GKE clusters that users are running, we found one in ten clusters are potentially running idle at any given time. While thereâs no one definition of an idle cluster, these clusters:
Arenât running any pods
Are out of date and about to lose connectivity to the control-plane nodes
Havenât had any API interaction and object changes for a long time
Have had no changes to pod count and are running at very low utilization levels
Shutting down an idle (or near-idle) cluster is easy:
First, review the âGKE Active/Idle clustersâ sample dashboard in Cloud Monitoring and confirm which of your clusters are indeed idle or significantly underutilized.
For this, go to Cloud Monitoring -> Dashboard -> Sample Library and in Categories, select Google Kubernetes Engine. The âGKE Active/Idle clustersâ are available in the sample list of the dashboard.
Once you confirm the cluster state, proceed to shutdown the cluster using your preferred method.
â¦one in ten clusters are potentially running idle at any given time.
Strategy 3: Establish an optimization and rightsizing routine
Level: EasyÂ
Impact: Medium-High
Poorly sized clusters and workloads create a significant amount of waste. As we pointed out above, among over-provisioned workloads, our internal research found 40% of them have provisioned 30 times the resources they actually use â and 11% of workloads have provisioned over 100 times the needed resources.Â
GKE has you covered, with multiple tools to help you rightsize your clusters:
Check GKEâs built-in cost insights to quickly locate the clusters and workloads that would make the most difference if rightsized.Â
Then, use GKEâs new, built-in workload rightsizing capability to get guidance on how to vertically rightsize your deployments.
If youâre happy with GKEâs workload rightsizing suggestions, consider activating the vertical pod autoscaler to automate the process and reduce operational effort.
To learn more, check our best practices and video guide on GKE autoscaling.
40% of over-provisioned workloads have 30 times the requested resources they actually use.
Strategy 4: Move to GKE Autopilot
Level: Easy-MediumÂ
Impact: High
Sure, reducing the cost of your infrastructure is important, but reducing your operations costs may be even more valuable, allowing you to free up valuable engineering talent, while helping you benefit from a more stable and secure environment.
This is what you get with GKE Autopilot mode of operation. Because itâs priced per pod resource request rather than by provisioned infrastructure, GKE Autopilot can achieve instant cost savings for the simple reason that you wonât get charged for any unused infrastructure that you provision. GKE Autopilot also eliminates one of the more important sources of waste and effort: inefficient bin-packing. And because GKE Autopilot implements configuration best practices by default, you need less Kubernetes expertise to set up your environment correctly, so spend less time managing the system.Â
On the basis of list price alone, GKE Autopilot might seem more expensive on a core/hour basis, but your reality might be different. When we looked across the entire GKE fleet, we found that as much as 45% of all clusters would be cheaper if they were migrated to GKE Autopilot today.
Want to get started with GKE Autopilot?
Get to know GKE Autopilot, its benefits and limitations
Watch the intro video to GKE Autopilot
Create your Autopilot cluster
45% of all clusters would be cheaper if they were migrated to GKE Autopilot today.
How low did your GKE costs go?
Here at Google Cloud, weâre passionate about making it easy for you to set up, run and manage your environment easily and cost-effectively. By implementing these four strategies today, we believe you will see a noticeable change in your GKE bill, as soon as next month! Even better, youâll lessen the load on your GKE administrators â and you may even see a reduction in your carbon footprint. Share the results of your GKE optimization efforts with us and the world on social media by using the hashtag #GKEoptimized.