Kubernetes v1.37: Scale Workloads to Zero with HorizontalPodAutoscaler
Kubernetes v1.37 just shipped a feature that could meaningfully reduce your cloud bill: the ability to scale workloads down to zero replicas using HorizontalPodAutoscaler (HPA). Previously, HPA would scale your deployments down to a minimum of 1 replica, keeping at least one pod running at all times. Now in Beta and enabled by default, HPA can completely remove pods when they’re not needed, then spin them back up instantly when demand returns.
Here’s how it works technically. The HorizontalPodAutoscaler watches metrics—either object metrics (like CPU or memory from your pods) or external metrics (from systems like Datadog or custom application metrics). When those metrics fall below your configured thresholds, HPA can now scale the deployment to zero. The key insight is that this requires a metric source capable of tracking inactivity, not just low resource usage. You might set a rule like “if requests per second drops below 1 for 5 minutes, scale to zero.” When traffic returns and metrics exceed the upper threshold, HPA immediately scales back up. There’s no cold start penalty beyond normal pod startup time—Kubernetes and your container runtime handle the launch quickly.
The practical value here is significant for certain workloads. Consider a batch processing pipeline that runs on-demand: it might sit idle for hours, burning money on unused compute, then spike during processing windows. With scale-to-zero HPA, those pods vanish entirely during idle periods, then auto-provision when new jobs arrive. The same applies to development and staging environments, internal tools that see sporadic use, or webhook processors that handle bursty traffic. A team we know using this pattern saw roughly 60-70% cost reduction on non-production clusters by letting unused workloads completely disappear.
To start using this feature, you’ll need to ensure your metrics provider supports it—most do, including Prometheus with custom metrics, cloud-native options like AWS CloudWatch, or managed Kubernetes monitoring. Your HPA manifest will look similar to existing configurations, but now you can safely set minReplicas: 0. Just remember that true zero-downtime requires your application to handle the startup gracefully and your metrics to accurately reflect when work is actually happening. For most teams, this is straightforward to implement and immediately valuable.