October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk5 min

When to Use a Custom Kubernetes Controller Instead of an Autoscaler

Use HPA for metric-driven replica changes. Build a custom controller when the requirement is domain-specific reconciliation beyond HPA’s scale interface.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check 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.

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.

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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

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.

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.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Crashes, No Sound, or Screen Glitches?Free driver scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.