Use a Kubernetes HorizontalPodAutoscaler (HPA) when the job is to change a supported workload’s replica count in response to resource use or a metric available through Kubernetes’ metrics APIs. Consider a custom controller when you need declarative, domain-specific reconciliation—such as coordinating objects, sequencing actions, or maintaining lifecycle state—that HPA’s metric-to-replica interface cannot express. Before building one, check whether an HPA setting, a supported metric, or a missing metrics adapter is the actual gap.
Start with the action you need Kubernetes to take
HPA changes the desired replica count of a supported scalable workload, such as a Deployment or StatefulSet. It is a good fit when a measurable signal can drive that change. A custom controller is worth considering when the desired action extends beyond replica count into application-specific state or coordinated lifecycle behavior.
As an Amazon Associate I earn from qualifying purchases.
| Question | HPA is a strong starting point when… | Consider custom reconciliation when… |
|---|---|---|
| What must change? | The required action is changing replicas on a resource with a scale subresource. | The action includes domain-specific objects, sequencing, or lifecycle state beyond changing replicas. |
| What drives the decision? | CPU, memory, custom, object, or external metrics can represent the workload signal. | The policy depends on state transitions or domain knowledge that cannot be represented by HPA metrics and behavior. |
| Are built-in controls enough? | Replica bounds, multiple metrics, and scaling behavior meet the requirement. | The needed policy remains unexpressible after checking the HPA API and configuration available in the cluster’s Kubernetes version. |
| Where is the gap? | The necessary metrics API and adapter can be installed or fixed. | The controller must coordinate broader desired state, not merely expose a scaling signal. |
| What response is acceptable? | Periodic metric-driven adjustment and its readiness and stabilization behavior fit the workload. | The application needs repeated reconciliation of its own domain-specific state. |
This is a capability test, not a universal rule: compare the actual workload policy and operating constraints with the behavior documented for your cluster.
What HPA can express
Replica count driven by metrics
The stable HPA API is autoscaling/v2. It supports resource and custom metrics, as well as multiple metrics. When several metrics are configured, HPA calculates a replica recommendation for each and uses the largest recommendation, subject to the configured replica bounds. See the Kubernetes HPA documentation for supported metrics and configuration.
#1 Best Overall
That makes an HPA suitable for signals such as CPU or memory use, or a custom or external measure of demand such as a queue-related metric—provided the metric is exposed through the required Kubernetes metrics API. A queue signal does not, by itself, require a bespoke controller.
Behavior is not an instantaneous metric-to-replica mapping
For CPU utilization targets, utilization is calculated against requested CPU resources, so appropriate Pod resource requests matter. HPA also accounts for missing metrics and Pods that are not yet ready, applies tolerance around the target, and supports stabilization behavior for scaling down. These factors influence the resulting replica count; it is not simply a direct response to every raw sample.
Rank #2
The HPA controller’s documented default sync period is 15 seconds, configured with the kube-controller-manager option --horizontal-pod-autoscaler-sync-period. The cluster may use a different setting, and this polling interval is not a guarantee of end-to-end time from changing demand to a ready Pod. Metric collection, scheduling, image startup, and application readiness also affect that outcome. See the HPA algorithm and configuration documentation.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minuteCheck the metrics path before writing code
HPA can act only on metrics made available through Kubernetes’ metrics APIs. Resource metrics are served through metrics.k8s.io, commonly by Metrics Server. Custom and external metrics use custom.metrics.k8s.io and external.metrics.k8s.io, typically provided by adapters. These aggregated APIs must be registered and available to the cluster. The Kubernetes documentation on HPA metrics describes these prerequisites.
Rank #3
If an HPA cannot see a queue metric or another external signal, diagnose that API and adapter path first. An unavailable metric is a plumbing problem, not evidence on its own that the scaling policy needs a custom controller. A custom controller becomes a better fit when it must continuously reconcile broader domain-specific state rather than translate an available signal into replica count.
What a custom resource and controller add
A custom resource provides structured API objects, but does not make those objects behave by itself. A custom controller watches them and repeatedly works to bring actual cluster objects in line with declared desired state. Together, they can provide a declarative API for domain-specific behavior. The Kubernetes Operator pattern describes using controllers and custom resources to encode domain knowledge.
Rank #4
That additional API and reconciliation loop are justified when users need to declare and maintain application-specific state or coordinate behavior that HPA cannot represent. If the remaining requirement is only to obtain a supported metric, extending the metrics path and configuring HPA may be simpler. This is an architectural judgment based on the different roles of HPA and custom reconciliation, not a Kubernetes rule that prescribes one design for every workload.
Distinguish replica scaling from adjacent autoscaling features
VPA changes resource sizing, not replica count
The Vertical Pod Autoscaler (VPA) is relevant when the desired change is a container’s resource requests or limits, rather than the number of replicas. Kubernetes describes VPA as a separately installed component that uses historical utilization, cluster resources, and events. It does not replace HPA when the required action is changing replicas. See the Kubernetes VPA documentation.
Best Value
Scale-to-zero depends on version and feature state
Kubernetes v1.37 documentation, published September 2, 2026, describes HPA scale-to-zero for eligible HPAs using object or external metrics as a beta capability enabled by default. Its tradeoff is cold-start time while the metric is observed, Pods are scheduled, and the application starts. Verify the version and feature state of the target cluster before relying on it. See the Kubernetes v1.37 scale-to-zero announcement.
Quick Recap
Pre-implementation checklist
- Name the exact desired change: replica count, resource requests and limits, or broader application lifecycle state.
- Identify the signal, its owner, units, freshness, and whether it is per-Pod, object, or external; confirm the required aggregated metrics API is registered.
- For CPU or memory utilization targets, confirm that resource requests are set appropriately, and check how Pod readiness affects the metric and scaling decision.
- Test whether replica bounds, multiple-metric behavior, tolerance, and scale-up or scale-down stabilization meet the workload’s response and safety needs.
- Check the target Kubernetes version and feature state for any version-sensitive capability, including scale-to-zero; include cold-start time in the design if it applies.
- Write down the policy HPA still cannot express. If it is durable domain state or coordinated reconciliation, define the custom resource and controller boundary. If it is not, avoid adding a custom API and controller lifecycle without a demonstrated need.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




