Cluster Autoscaler: Provisioning & Strategies
Enabling Scaling (Standard)
cluster autoscaler - Per Pool
- Enable (New Pool):
gcloud container node-pools create <POOL> \ --enable-autoscaling --min-nodes=1 --max-nodes=10 - Enable (Existing Pool):
gcloud container clusters update <CLUSTER> \ --enable-autoscaling --node-pool=<POOL> \ --min-nodes=1 --max-nodes=10
Node Auto Provisioning - Cluster-wide
- Enable:
gcloud container clusters update <CLUSTER> \ --enable-autoprovisioning \ --min-cpu=4 --max-cpu=200 \ --min-memory=16 --max-memory=800
Node pool auto-creation - Per ComputeClass
- Enable: Set
nodePoolAutoCreation.enabled: truein the ComputeClass. - GKE 1.33.3+: Works without cluster-wide Node Auto Provisioning enabled.
Provisioning Strategies
| Strategy | Strengths | Use Case |
|---|---|---|
| Manual Pools | Fast scheduling; Stable names. | Latency-sensitive; manual management. |
| node pool auto-creation (ComputeClass) | Best obtainability; Scale-to-zero. | Bursty; batch; cost-sensitive. |
| Hybrid | Manual pool at top; node pool auto-creation fallback. | Recommended for Production. |
Cutover: Node Auto Provisioning to node pool auto-creation
- Apply ComputeClasses: Create classes with
nodePoolAutoCreation.enabled: true. - Opt Workloads In: Apply
nodeSelector: cloud.google.com/compute-class: <name>. - Drain Old Pools:
kubectl drainnodes in old Node Auto Provisioning-managed pools.
Scale-to-Zero Behavior
- Manual Pools: Standard cluster autoscaler keeps ≥1 node unless empty pool deletion is supported/enabled.
- node pool auto-creation-managed: Autoscaler can delete the entire pool when empty.