@@ -143,8 +143,8 @@ is `100m`, the number of replicas will be doubled, since
143143\\ ( { 200.0 \div 100.0 } = 2.0 \\ ).
144144If the current value is instead ` 50m ` , you'll halve the number of
145145replicas, since \\ ( { 50.0 \div 100.0 } = 0.5 \\ ). The control plane skips any scaling
146- action if the ratio is sufficiently close to 1.0 (within a globally-configurable
147- tolerance, 0.1 by default).
146+ action if the ratio is sufficiently close to 1.0 (within a
147+ [ configurable tolerance] ( #tolerance ) , 0.1 by default).
148148
149149When a ` targetAverageValue ` or ` targetAverageUtilization ` is specified,
150150the ` currentMetricValue ` is computed by taking the average of the given
@@ -388,9 +388,10 @@ to configure separate scale-up and scale-down behaviors.
388388You specify these behaviours by setting `scaleUp` and / or `scaleDown`
389389under the `behavior` field.
390390
391- You can specify a _stabilization window_ that prevents [flapping](#flapping)
392- the replica count for a scaling target. Scaling policies also let you control the
393- rate of change of replicas while scaling.
391+ Scaling policies let you control the rate of change of replicas while scaling.
392+ Also two settings can be used to prevent [flapping](#flapping): you can specify a
393+ _stabilization window_ for smoothing replica counts, and a tolerance to ignore
394+ minor metric fluctuations below a specified threshold.
394395
395396# ## Scaling policies
396397
@@ -452,6 +453,29 @@ interval. In the above example, all desired states from the past 5 minutes will
452453This approximates a rolling maximum, and avoids having the scaling algorithm frequently
453454remove Pods only to trigger recreating an equivalent Pod just moments later.
454455
456+ # ## Tolerance {#tolerance}
457+
458+ {{< feature-state feature_gate_name="HPAConfigurableTolerance" >}}
459+
460+ The `tolerance` field configures a threshold for metric variations, preventing the
461+ autoscaler from scaling for changes below that value.
462+
463+ This tolerance is defined as the amount of variation around the desired metric value under
464+ which no scaling will occur. For example, consider a HorizontalPodAutoscaler configured
465+ with a target memory consumption of 100Mi and a scale-up tolerance of 5% :
466+
467+ ` ` ` yaml
468+ behavior:
469+ scaleUp:
470+ tolerance: 0.05 # 5% tolerance for scale up
471+ ` ` `
472+
473+ With this configuration, the HPA algorithm will only consider scaling up if the memory
474+ consumption is higher than 105Mi (i.e. 5% above the target).
475+
476+ If you don't set this field, the HPA applies a default cluster-wide tolerance, which
477+ is typically 10%.
478+
455479# ## Default Behavior
456480
457481To use the custom scaling not all fields have to be specified. Only values which need to be
0 commit comments