@@ -17,7 +17,7 @@ a new alpha feature first available in Kubernetes 1.33.
17
17
18
18
## What is it?
19
19
20
- [ Horizontal Pod autoscaling ] ( /docs/tasks/run-application/horizontal-pod-autoscale/ )
20
+ [ Horizontal Pod Autoscaling ] ( /docs/tasks/run-application/horizontal-pod-autoscale/ )
21
21
(HPA) is a well-known Kubernetes feature that allows your workload to
22
22
automatically resize by adding or removing replicas based on resource
23
23
utilization.
@@ -26,8 +26,8 @@ To decide how many replicas a workload requires, users configure their HPA
26
26
with a metric (e.g. CPU utilization) and an expected value for this metric (e.g.
27
27
80%). The HPA updates the number of replica based on the ratio between the
28
28
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).
31
31
32
32
In order to avoid replicas being created or deleted whenever a small metric
33
33
fluctuation occurs, Kubernetes applies a form of hysteresis: it only changes the
@@ -37,22 +37,23 @@ than 10%.
37
37
This default tolerance of 10% is cluster-wide; in older Kubernetes releases, it
38
38
could not be fine-tuned. It's a suitable value for most usage, but too coarse
39
39
for large deployments, where a 10% tolerance represents tens of pods. As a
40
- result, users have long
40
+ result, the community has long
41
41
[ asked] ( https://github.com/kubernetes/kubernetes/issues/116984 ) to be able to
42
42
tune this value.
43
43
44
44
In Kubernetes v1.33, this is now possible.
45
45
46
46
## How do I use it?
47
47
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
50
51
HorizontalPodAutoscaler object.
51
52
52
53
Tolerances appear under the ` spec.behavior.scaleDown ` and
53
54
` spec.behavior.scaleUp ` fields and can thus be different for scale up and scale
54
55
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
56
57
replicas too quickly in response to small metric fluctuations).
57
58
58
59
For example, an HPA with a tolerance of 5% on scale-down, and no tolerance on
72
73
tolerance : 0
73
74
` ` `
74
75
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
+
75
81
## I want all the details!
76
82
77
83
Get all the technical details by reading
0 commit comments