HPA
Optimize Live integrates with Horizontal Pod Autoscalers (HPA) and can:
- Generate vertical rightsizing recommendations for HPA-managed workloads
- Preserve HPA scaling behavior when adjusting resource requests
How Optimize Live integrates with HPA
Optimize Live integrates with the HPA by adjusting HPA target utilization when Pod resource requests change.
Because HPA scaling is based on a percentage of resource requests, changing requests without adjusting target utilization changes how a workload scales.
Optimize Live balances vertical sizing changes with corresponding adjustments to HPA target utilization so the workload continues to scale at the same overall load level.
The HPA scale point is the average Pod resource usage level at which the HPA begins adding or removing replicas.
The scale point determines how many replicas the HPA deploys to handle a given load.
Preserving the scale point is usually the desired behavior because it maintains a workload’s horizontal scaling characteristics.
The settings in this section control how strictly Optimize Live preserves the scale point, and whether it may change it for idle or saturated workloads.
HPA settings
Use these settings to control how Optimize Live interacts with HPA-managed workloads.
- Minimum and maximum bounds for HPA target utilization
- Preserve horizontal scale point
- Ignore horizontally-scaled resources
Minimum and maximum bounds for HPA target utilization
Specifies the lower and upper bounds within which Optimize Live can set HPA target utilization.
| Annotation | Default value |
|---|---|
live.stormforge.io/hpa.cpu.target-utilization.min |
"50" |
live.stormforge.io/hpa.cpu.target-utilization.max |
"90" |
live.stormforge.io/hpa.memory.target-utilization.min |
"50" |
live.stormforge.io/hpa.memory.target-utilization.max |
"90" |
Description
These constraints prevent Optimize Live from recommending HPA target utilization values outside the defined bounds. CPU and memory constraints are configured separately.
These settings take effect only when:
- An HPA is enabled for a workload
- The HPA scales on CPU or memory
Valid values
- Integer strings from
"0"to"100"
Preserve horizontal scale point
Controls whether Optimize Live constrains resource request recommendations to maintain a stable HPA scale point.
| Annotation | Default value |
|---|---|
live.stormforge.io/hpa.preserve-horizontal-scale-point |
"False" |
Description
When Optimize Live adjusts resource requests for workloads with an HPA, the HPA scale point may change.
This setting controls whether, and under what circumstances, Optimize Live may recommend values that change the scale point, in combination with other configuration constraints such as min/max bounds for HPA target utilization.
Valid values
True
Recommendations never cause the HPA scale point to change.
Vertical sizing recommendations are constrained to values that can be balanced by corresponding adjustments to HPA target utilization without violating the configured min/max bounds for HPA target utilization.
Use this setting to preserve HPA scaling behavior in both directions. This ensures the workload scales up and down the same way it did before Optimize Live was enabled, but may limit some potential cost savings.
False (default)
Recommendations may cause the HPA scale point to change.
Optimize Live attempts to preserve the scale point for actively scaling workloads, but may change it for:
- An idle HPA that runs with
minReplicasmost or all of the time - A saturated HPA that runs with
maxReplicasmost or all of the time - A workload whose observed target utilization falls outside the configured min/max bounds for HPA target utilization
Use this setting when you want Optimize Live to preserve HPA scaling behavior where possible while allowing scale point changes that improve cost efficiency or reliability.
UnlessUnderProvisioned
Recommendations never reduce resource requests in a way that causes the HPA scale point to change.
Optimize Live may recommend increasing resource requests to correct underprovisioning, even if doing so changes the scale point.
Use this setting when you want to preserve scaling behavior in most cases, but allow scale point changes to resolve underprovisioned workloads with a saturated HPA (running at maxReplicas).
Ignore horizontally-scaled resources
Controls whether Optimize Live recommends changes to resource requests for resources scaled by an HPA.
| Annotation | Default value |
|---|---|
live.stormforge.io/hpa.ignore-horizontally-scaled-resources |
"False" |
Description
In some environments, you may want to disable automatic rightsizing for resources scaled by an HPA.
For example, you may want to preserve manual CPU request and HPA configuration while still allowing Optimize Live to rightsize memory.
When this setting is enabled, Optimize Live doesn’t recommend changes to resource requests for resources scaled by an HPA.
Valid values
True
Optimize Live doesn’t make recommendations for resources scaled by an HPA.
False (default)
Optimize Live may make recommendations for resources scaled by an HPA.