How do you scale Kubernetes workloads and nodes to zero?
Scaling Kubernetes to zero happens in two layers. First a Pod autoscaler, such as KEDA, Knative or the Horizontal Pod Autoscaler on an external metric, sets a workload’s replicas to 0 when there is no work. Then the node autoscaler removes the nodes those Pods ran on. Only the second step saves money, because you pay for nodes, not for Pods.
The two layers
| Layer | Tool | Scales from zero on | Notes |
|---|---|---|---|
| Pods | KEDA | Queue length, events, metrics, schedules | Add-on; scales to zero by default |
| Pods | Knative Serving | Incoming HTTP requests | Add-on; holds requests while a Pod starts |
| Pods | Horizontal Pod Autoscaler | Object or external metrics | Built in; scale to zero is beta since Kubernetes 1.37 |
| Nodes | Cluster autoscaler | Pending Pods | Node groups with a minimum size of 0 |
| Nodes | Node auto-provisioning | Pending Pods | Creates nodes per Pod, no node groups to keep warm |
The general mechanics of each autoscaler are in how Kubernetes autoscaling works. This article covers the zero case.
Scaling Pods to zero
HPA on external metrics
For years the HPA could not go below one replica unless you enabled the alpha HPAScaleToZero feature gate. Since Kubernetes 1.37 the gate is beta and enabled by default, so you can set minReplicas: 0. It works only with object or external metrics, such as the length of a queue. CPU and memory metrics are measured on running Pods, so a workload at zero has no CPU reading to wake it, and the API server rejects minReplicas: 0 without an object or external metric. Managed services adopt new Kubernetes versions on their own schedule, so check that your cluster runs 1.37 or later.
KEDA
KEDA, a CNCF project, connects a Deployment or StatefulSet to an event source such as a message queue, a stream, a database query or a cron schedule. It splits the work into two phases. KEDA itself handles activation, the step between 0 and 1 replica. From 1 replica upward, it creates an HPA and hands the scaling to it. In a ScaledObject, minReplicaCount defaults to 0, and cooldownPeriod (300 seconds by default) sets how long the source must stay idle before the last replica goes.
KEDA fits workloads where work waits in a queue. Messages stay in the queue while the first Pod starts, so nothing is lost.
Knative for HTTP traffic
HTTP is harder, because a request that arrives while no Pod runs has nowhere to go. Knative Serving puts an activator component in the request path when a revision has no Pods. The activator holds incoming requests, triggers a scale-up and forwards them once a Pod is ready. Scale to zero is on by default, with a 30-second grace period before the last Pod is removed. KEDA has a separate HTTP add-on, in beta as of November 2026, that scales HTTP servers to and from zero on incoming traffic.
Schedules
Development, staging and preview environments often sit idle at night and on weekends. A KEDA cron scaler or a scheduled job that sets replicas to 0 outside working hours stops their Pods, and the node autoscaler then removes their nodes.
Scaling nodes to zero
A node costs money as long as it exists, even with no Pods on it. The cluster autoscaler supports node groups with a minimum size of 0. It removes a node after it has been unneeded for 10 minutes by default and adds one when a Pod is pending. To scale up a group that has no nodes, it must know what a new node would look like. On AWS, for example, Auto Scaling groups need tags that describe the labels a node would carry, or Pods with a nodeSelector stay pending.
Node auto-provisioning avoids node groups. It reads the requirements of each pending Pod, creates a node that fits, and deletes the node when nothing runs on it. No pool has to keep a minimum of one node per instance type.
What keeps a node alive
A node is only removed when every Pod on it can move or stop. These Pods block removal:
| Blocker | Why |
|---|---|
kube-system Pods without a PodDisruptionBudget | The cluster autoscaler leaves them alone by default |
| A PodDisruptionBudget that allows no evictions | Evicting the Pod would break the budget |
| Pods with local storage | hostPath or a disk-backed emptyDir would lose data |
cluster-autoscaler.kubernetes.io/safe-to-evict: "false" | Opts the Pod out of eviction |
| Pods without a controller | Nothing would recreate them |
DaemonSet Pods do not block removal. Cluster add-ons such as CoreDNS, metrics-server and ingress controllers run as ordinary Pods in most clusters. Clusters therefore usually keep one small node for system components and scale the workload node pools to zero. The same blockers also leave half-empty nodes running, which is covered in bin packing and consolidation.
The cost of starting from zero
A workload at zero pays for its savings in startup time. Every step adds latency to the first request:
- A new node. A cloud virtual machine has to boot, join the cluster and become ready.
- The image pull. Large images take longer on a fresh node with an empty cache.
- Application startup. Runtimes with a slow start, such as a JVM, add their own warm-up.
- GPU workloads. The node needs drivers, and the model weights have to load into GPU memory. Weights for large models are tens to hundreds of gigabytes, which is why LLM inference keeps a warm replica for user-facing models.
When to scale to zero, and when not to
Good candidates are queue consumers, batch and CI jobs, internal tools used a few hours a day, non-production environments, and GPU workloads with occasional traffic. For GPUs the saving per idle hour is the largest; see how to reduce GPU costs.
Keep at least one replica for services with a latency target on the first request, for databases and other stateful systems, and for workloads whose warm-up takes longer than the idle periods they would save.
Scaling to zero on Cloudfleet
A Cloudfleet Kubernetes Engine (CFKE) cluster starts without worker nodes. Node auto-provisioning creates nodes when Pods are pending and deletes them when they are no longer needed, so Pods scaled to zero with KEDA or an HPA leave no nodes behind to pay for.