Skip to content

Commit fae8cf5

Browse files
committed
Update following review.
1 parent f0e0691 commit fae8cf5

File tree

1 file changed

+23
-26
lines changed

1 file changed

+23
-26
lines changed

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

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -6,75 +6,72 @@ slug: hpa-configurable-tolerance
66
# the release comms team can confirm which date has been assigned
77
#
88
# PRs to remove the draft marker should be opened BEFORE release day
9-
draft: true
9+
draft: true
1010
math: true # for formulae
1111
date: XXXX-XX-XX
12-
author: "Jean-Marc François"
12+
author: "Jean-Marc François (Google)"
1313
---
1414

1515
This post describes _configurable tolerance for horizontal Pod autoscaling_,
1616
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/) (HPA) is a
21-
well-known Kubernetes feature that
22-
allows your workload to automatically resize by adding or removing replicas
23-
based on resource utilization.
20+
[Horizontal Pod autoscaling](/docs/tasks/run-application/horizontal-pod-autoscale/)
21+
(HPA) is a well-known Kubernetes feature that allows your workload to
22+
automatically resize by adding or removing replicas based on resource
23+
utilization.
2424

2525
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
2929
replicas, the CPU utilization is 88%, and the desired utilization is 80%, the
30-
HPA will ask for `100 * (88/80)` replicas).
30+
HPA will ask for \\(100 \times (88/80)\)) replicas).
3131

3232
In order to avoid replicas being created or deleted whenever a small metric
33-
fluctuation occurs, Kubernetes applies a form of hysteresis: it only changes the number of replicas
34-
when the the current and desired metric values
35-
differ by more than 10%.
33+
fluctuation occurs, Kubernetes applies a form of hysteresis: it only changes the
34+
number of replicas when the the current and desired metric values differ by more
35+
than 10%.
3636

37-
This default tolerance of 10% is cluster-wide; in older Kubernetes releases, it could not be fine-tuned. It's
38-
a suitable value for most usage, but too coarse for large deployments, where a
39-
10% tolerance represents tens of pods. As a result,
40-
users have long [asked](https://github.com/kubernetes/kubernetes/issues/116984)
41-
to be able to tune this value.
37+
This default tolerance of 10% is cluster-wide; in older Kubernetes releases, it
38+
could not be fine-tuned. It's a suitable value for most usage, but too coarse
39+
for large deployments, where a 10% tolerance represents tens of pods. As a
40+
result, users have long
41+
[asked](https://github.com/kubernetes/kubernetes/issues/116984) to be able to
42+
tune this value.
4243

43-
In Kubernetes v1.33,
44-
``
45-
this is now possible.
44+
In Kubernetes v1.33, this is now possible.
4645

4746
## How do I use it?
4847

49-
Just add the tolerance you want an HPA to use to your `HorizontalPodAutoscaler`
50-
resource.
48+
Enable the `HPAConfigurableTolerance` feature flag in your Kubernetes 1.33
49+
cluster, then add the tolerance you want an HPA to use to your
50+
HorizontalPodAutoscaler object.
5151

5252
Tolerances appear under the `spec.behavior.scaleDown` and
5353
`spec.behavior.scaleUp` fields and can thus be different for scale up and scale
5454
down. A typical usage would be to specify a small tolerance on scale up (to
5555
react quickly to spikes), but lower on scale down (to avoid adding and removing
5656
replicas too quickly in response to small metric fluctuations).
5757

58-
For example, an HPA with a tolerance of 5% on scale-down, and no
59-
tolerance on scale-up, would look like the following:
58+
For example, an HPA with a tolerance of 5% on scale-down, and no tolerance on
59+
scale-up, would look like the following:
6060

6161
```yaml
6262
apiVersion: autoscaling/v2
6363
kind: HorizontalPodAutoscaler
6464
metadata:
6565
name: my-app
6666
spec:
67-
67+
...
6868
behavior:
6969
scaleDown:
7070
tolerance: 0.05
7171
scaleUp:
7272
tolerance: 0
7373
```
7474
75-
Note: This feature is in alpha in Kubernetes 1.33, gated by the
76-
`HPAConfigurableTolerance` flag.
77-
7875
## I want all the details!
7976
8077
Get all the technical details by reading

0 commit comments

Comments
 (0)