Skip to Content
Core InfraSpot OptimizationGCP with Cluster Autoscaler

GCP with default Cluster Autoscaler Spot Optimization
Available in v1.19.3+

This guide covers GCP-specific implementation details for Spot Optimization using GKE with Cluster Autoscaler. For general information about Spot Optimization, see the main overview.

ℹ️

This feature is currently available for GCP GKE clusters with autoscaling enabled on node pools.

Feature Enablement

Before using Spot Optimization, complete the Google Node Integration setup. During the integration set up, note you need to grant ScaleOps impersonation permissions to manage node pools, as described here. Once enabled, the feature will be available in the Spot Optimization section of your ScaleOps dashboard.

GCP Implementation with Cluster Autoscaler

Scheduling

In GKE with Cluster Autoscaler, ScaleOps implements a direct scheduling approach that provides immediate control over pod placement. When spot instances are available, ScaleOps uses Required Affinity to force spot node scaling, ensuring pods are scheduled on spot nodes. If spot nodes become unavailable and fallback is enabled, the system automatically switches to Preferred Affinity, allowing pods to be scheduled on on-demand nodes while maintaining the desired spot percentage when capacity becomes available again.

Fallback to On-Demand Toggle

The fallback mechanism in GKE works as follows:

  • When Enabled: Uses Required Affinity initially, then switches to Preferred Affinity if spot nodes aren’t available
  • When Disabled: Uses Required Affinity only, meaning pods will only schedule on spot nodes

ScaleOps automatically detects spot availability and adjusts affinity rules accordingly

Limitations

Prerequisites

  • Enable GCP Node Integration
  • Node pools must have autoscaling enabled
  • Sufficient Spot quota in your GCP project. If quota is insufficient, optimization will be blocked and optimization gaps will be displayed.
  • The cluster must not have node autoprovisioning enabled. If node autoprovisioning is enabled, the feature will be disabled.

Workload Support

  • Currently only supports Deployments

Node Pool Constraints

GKE node pools that don’t support Spot nodes won’t be mirrored - sole-tenant nodes and specific shared reservation node pools are not supported.

Existing Configuration Constraints

  • Workloads with existing required affinity, node selector or topology spread constraints on the lifecycle label will not be optimized (shown as optimization gap in the workload table and workloads overview)

Increased Max Nodes Limits

Since ScaleOps creates mirrored node pools, the total maximum nodes across both original and mirrored pools effectively doubles your cluster’s max node capacity.