You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: vertical-pod-autoscaler/enhancements/8515-support-custom-request-to-limit-ratio/README.md
+16-20Lines changed: 16 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,11 +38,10 @@ The feature is gated by a new alpha feature flag, `RequestToLimitRatio`, which i
38
38
* Provide a feature gate to enable or disable the feature (`RequestToLimitRatio`).
39
39
* Allow VPA to update the request-to-limit ratio of a Pod's containers during Pod recreation or in-place updates.
40
40
* Introduce a new `RequestToLimitRatio` block that enables users to adjust the request-to-limit ratio in the following ways:
41
-
***Factor**: Multiplies the recommended request by a specified value, and the result is set as the new limit.
42
-
* Example: if `factor` is set to `2`, the limit will be set to twice the recommended request.
43
-
***Quantity**: Adds a buffer on top of the resource request. This can be expressed either:
44
-
* As a **percentage** (`QuantityPercentage`), or
45
-
* As an **absolute value with units** (`QuantityValue`).
41
+
***Factor**: Multiplies the recommended request by a specified value, and the result is set as the new limit, for example:
42
+
* If the value for `Factor` is set to `2`, the limit will be twice the recommended request.
43
+
* If the value for `Factor` is set to `1.1`, the limit will be 10% higher than the recommended request.
44
+
***Quantity**: Adds a buffer on top of the resource request. This can be expressed as an **absolute value with units** (e.g. `100Mi`, `10m`).
46
45
47
46
## Non-Goals
48
47
@@ -62,19 +61,16 @@ Some examples of the VPA CRD using the new `RequestToLimitRatio` field are provi
62
61
A new `RequestToLimitRatio` field will be added, with the following sub-fields:
63
62
64
63
*`RequestToLimitRatio.CPU.Type` or `RequestToLimitRatio.Memory.Type` (type: `string`, required): Specifies how to apply limits proportionally to the requests. `Type` can have the following values:
65
-
*`Factor` (type: `integer`): Interpreted as a multiplier for the recommended request.
64
+
*`Factor` (type: `floating-point number`): Interpreted as a multiplier for the recommended request.
66
65
* Example: a value of `2` will double the limits.
67
-
*`QuantityValue` (type: `string`): Adds an absolute value on top of the requests to determine the new limit.
68
-
* Example: for memory, a value of `100Mi` means the new limit will be: calculated Memory request + `100Mi`.
69
-
*`QuantityPercentage` (type: `integer`): Increases the limit by the specified percentage of the resource request.
70
-
* Example: if the request is 1000m CPU and the percentage is 20, the limit will be 1000m + (20% of 1000m) = 1200m.
66
+
*`Quantity` (type: `string`): Adds an absolute value on top of the requests to determine the new limit.
67
+
* Example: for memory, a value of `100Mi` means the new limit will be: calculated memory request + `100Mi`.
71
68
72
69
*`RequestToLimitRatio.CPU.Value` (type: `string`, required): Specifies the magnitude of the ratio between request and limit, interpreted according to `RequestToLimitRatio.CPU.Type`:
73
70
* If `Type` is `Factor`: a value of `3` will triple the CPU limits.
74
-
* If `Type` is `QuantityValue`: if the value is set to 200m, then the CPU limit will be set to the CPU request plus 200 millicores.
75
-
* If `Type` is `QuantityPercentage`: a value of `20` increases the CPU limit by 20% of the calculated request.
71
+
* If `Type` is `Quantity`: if the value is set to 200m, then the CPU limit will be set to the CPU request plus 200 millicores.
76
72
77
-
*`RequestToLimitRatio.Memory.Value` (type: `string`): Similar to `CPU.Value`, except that for `QuantityValue` the units are memory-based (e.g., `Mi`, `Gi`) rather than CPU millicores (`m`).
73
+
*`RequestToLimitRatio.Memory.Value` (type: `string`, required): Similar to `CPU.Value`, except that for `Quantity` the units are memory-based (e.g., `Mi`, `Gi`) rather than CPU millicores (`m`).
78
74
79
75
### Behavior
80
76
@@ -114,12 +110,11 @@ The behavior after implementing this feature is as follows:
114
110
115
111
* The `RequestToLimitRatio` configuration will be validated when VPA CRD objects are created or updated. For example:
116
112
* If `Type` is `Factor`, the value must be greater than or equal to 1 (enforced via CRD validation rules).
117
-
* If `Type` is `QuantityPercentage`, the value must be greater than or equal to 1 (enforced via CRD validation rules).
118
113
119
114
#### Dynamic Validation via Admission Controller
120
115
121
116
* When using the new `RequestToLimitRatio` field, the `controlledValues` field must be set to `RequestsAndLimits`. It does not make sense to specify `RequestToLimitRatio` if VPA is not allowed to update limits. This requirement is enforced by the admission controller.
122
-
* If `Type` is set to `QuantityValue`, then its `Value` will be validated.
117
+
* If `Type` is set to `Quantity`, then its `Value` will be validated.
123
118
124
119
### Feature Enablement and Rollback
125
120
@@ -182,11 +177,11 @@ spec:
182
177
Type: Factor
183
178
Value: 2
184
179
memory:
185
-
Type: QuantityValue
180
+
Type: Quantity
186
181
Value: 200Mi
187
182
```
188
183
189
-
In the manifest below, we configure VPA to control only the CPU resource's requests and limits for the container named `app`. The CPU limit is calculated by increasing the recommended CPU request by 30%.
184
+
In the manifest below, we configure VPA to control only the CPU resource's requests and limits for the container named `app`. The CPU limit is calculated by increasing the recommended CPU request by 20% (i.e. `recommended request × 1.2`).
190
185
191
186
```yaml
192
187
apiVersion: autoscaling.k8s.io/v1
@@ -207,10 +202,11 @@ spec:
207
202
controlledValues: RequestsAndLimits
208
203
RequestToLimitRatio:
209
204
cpu:
210
-
Type: QuantityPercentage
211
-
Value: 30
205
+
Type: Factor
206
+
Value: 1.2
212
207
```
213
208
214
209
## Implementation History
215
210
216
-
* 2025-09-10: Initial proposal created.
211
+
* 2025-09-10: Initial proposal created.
212
+
* 2025-09-10: Drop `QuantityPercentage` and rename `QuantityValue` to `Quantity`.
0 commit comments