Skip to content

Commit 05d8131

Browse files
committed
Updates following review (small fixes, added example).
1 parent e0b0782 commit 05d8131

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

content/en/blog/_posts/XXXX-XX-XX-hpa-configurable-tolerance.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ a new alpha feature first available in Kubernetes 1.33.
1717

1818
## What is it?
1919

20-
[Horizontal Pod autoscaling](/docs/tasks/run-application/horizontal-pod-autoscale/)
20+
[Horizontal Pod Autoscaling](/docs/tasks/run-application/horizontal-pod-autoscale/)
2121
(HPA) is a well-known Kubernetes feature that allows your workload to
2222
automatically resize by adding or removing replicas based on resource
2323
utilization.
@@ -26,8 +26,8 @@ To decide how many replicas a workload requires, users configure their HPA
2626
with a metric (e.g. CPU utilization) and an expected value for this metric (e.g.
2727
80%). The HPA updates the number of replica based on the ratio between the
2828
current and desired metric value. (For example, if there are currently 100
29-
replicas, the CPU utilization is 88%, and the desired utilization is 80%, the
30-
HPA will ask for \\(100 \times (88/80)\)) replicas).
29+
replicas, the CPU utilization is 84%, and the desired utilization is 80%, the
30+
HPA will ask for \\(100 \times (84/80)\\)) replicas).
3131

3232
In order to avoid replicas being created or deleted whenever a small metric
3333
fluctuation occurs, Kubernetes applies a form of hysteresis: it only changes the
@@ -37,22 +37,23 @@ than 10%.
3737
This default tolerance of 10% is cluster-wide; in older Kubernetes releases, it
3838
could not be fine-tuned. It's a suitable value for most usage, but too coarse
3939
for large deployments, where a 10% tolerance represents tens of pods. As a
40-
result, users have long
40+
result, the community has long
4141
[asked](https://github.com/kubernetes/kubernetes/issues/116984) to be able to
4242
tune this value.
4343

4444
In Kubernetes v1.33, this is now possible.
4545

4646
## How do I use it?
4747

48-
Enable the `HPAConfigurableTolerance` [feature gate](/docs/reference/command-line-tools-reference/feature-gates/) in your Kubernetes 1.33
49-
cluster, then add the tolerance you want an HPA to use to your
48+
After enabling the `HPAConfigurableTolerance`
49+
[feature gate](/docs/reference/command-line-tools-reference/feature-gates/) in
50+
your Kubernetes v1.33 cluster, you can add your desired tolerance for your
5051
HorizontalPodAutoscaler object.
5152

5253
Tolerances appear under the `spec.behavior.scaleDown` and
5354
`spec.behavior.scaleUp` fields and can thus be different for scale up and scale
5455
down. A typical usage would be to specify a small tolerance on scale up (to
55-
react quickly to spikes), but lower on scale down (to avoid adding and removing
56+
react quickly to spikes), but higher on scale down (to avoid adding and removing
5657
replicas too quickly in response to small metric fluctuations).
5758

5859
For example, an HPA with a tolerance of 5% on scale-down, and no tolerance on
@@ -72,6 +73,11 @@ spec:
7273
tolerance: 0
7374
```
7475
76+
Consider the previous scenario where the ratio of current to desired metric
77+
values is \\(84/80\\), a 5% increase. With the default 10% scale-up tolerance,
78+
no scaling occurs. However, with the HPA configured as shown, featuring a 0%
79+
scale-up tolerance, the 5% increase triggers scaling.
80+
7581
## I want all the details!
7682
7783
Get all the technical details by reading

0 commit comments

Comments
 (0)